]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/theme_loader.cpp
Finish the initialization in the Open function.
[vlc] / modules / gui / skins2 / src / theme_loader.cpp
index a304ed491c356b04400a15032a7a29b6b20ee4bc..c547fda7c72d48f89340e4b843e034f4dc17548f 100644 (file)
@@ -52,7 +52,7 @@
 #if defined( HAVE_ZLIB_H )
 #   include <zlib.h>
 #   include <errno.h>
-int gzopen_frontend ( char *pathname, int oflags, int mode );
+int gzopen_frontend ( const char *pathname, int oflags, int mode );
 int gzclose_frontend( int );
 int gzread_frontend ( int, void *, size_t );
 int gzwrite_frontend( int, const void *, size_t );
@@ -114,7 +114,7 @@ bool ThemeLoader::load( const string &fileName )
         // Show the windows
         pNewTheme->getWindowManager().showAll( true );
     }
-    if( skin_last ) free( skin_last );
+    free( skin_last );
 
     // The new theme cannot embed a video output yet
     VlcProc::instance( getIntf() )->dropVout();
@@ -217,10 +217,7 @@ bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir )
     // Allocate the buffer
     void *pBuffer = malloc( ZIP_BUFFER_SIZE );
     if( !pBuffer )
-    {
-        msg_Err( getIntf(), "failed to allocate memory" );
         return false;
-    }
 
     // Get the path of the file
     OSFactory *pOsFactory = OSFactory::instance( getIntf() );
@@ -632,6 +629,7 @@ int tar_extract_all( TAR *t, char *prefix )
                 {
                     fprintf( stderr, "error writing %s skipping...\n", fname );
                     fclose( outfile );
+                    outfile = NULL;
                     unlink( fname );
                 }
             }
@@ -738,9 +736,9 @@ int makedir( const char *newdir )
 static int currentGzFd = -1;
 static void * currentGzVp = NULL;
 
-int gzopen_frontend( char *pathname, int oflags, int mode )
+int gzopen_frontend( const char *pathname, int oflags, int mode )
 {
-    char *gzflags;
+    const char *gzflags;
     gzFile gzf;
 
     switch( oflags )