]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix crashing on opening a file via recent menu after a .vik file is opened.
authorRob Norris <rw_norris@hotmail.com>
Sun, 4 Dec 2011 20:32:33 +0000 (20:32 +0000)
committerRob Norris <rw_norris@hotmail.com>
Sun, 4 Dec 2011 20:32:46 +0000 (20:32 +0000)
Follow on to previous fix in commit: 08812b09d0bb6062a68b8aa90e6f07c78fd83923.

Issue derives from commit: 6e4a49aa9ec3ca64334124a009d4774a7bb4bb8e back in early 2008, which replaced GtkFileSelection by GtkFileChooser, this changes the signal callback from using an array of strings (gchar**) to being a GSList type.

Thus update to use the correct type methods.

src/vikwindow.c

index f444b87e3cf8df0cd0720979ff615e8acf2b3efb..1ea18f1549671e4040aa2446ae97ab90b227d697 100644 (file)
@@ -1670,12 +1670,15 @@ static void on_activate_recent_item (GtkRecentChooser *chooser,
     g_object_unref ( file );
     if ( self->filename )
     {
-      gchar *filenames[] = { path, NULL };
+      GSList *filenames = NULL;
+      filenames = g_slist_append ( filenames, path );
       g_signal_emit ( G_OBJECT(self), window_signals[VW_OPENWINDOW_SIGNAL], 0, filenames );
+      // NB: GSList & contents are freed by main.open_window
     }
-    else
+    else {
       vik_window_open_file ( self, path, TRUE );
-    g_free ( path );
+      g_free ( path );
+    }
   }
 
   g_free (filename);