From e6fa252184e92a4be2a3aa6f375e6609d9e294e7 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 21 Nov 2008 17:27:16 +0000 Subject: [PATCH] Create geany_object in main.c so core functions can use it even when plugins are disabled. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3265 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ src/main.c | 7 +++++++ src/plugins.c | 4 ---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9eb9205d..a5d4d57d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ Update from file made by Tyler D'Agosta (thanks). This version includes all character entities defined by HTML 2.0, HTML 3.2, and HTML 4.0, and one (') defined in XHTML 1.0. + * src/plugins.c, src/main.c: + Create geany_object in main.c so core functions can use it even + when plugins are disabled. 2008-11-20 Nick Treleaven diff --git a/src/main.c b/src/main.c index 07c6266d..b6dcee35 100644 --- a/src/main.c +++ b/src/main.c @@ -72,6 +72,7 @@ #include "navqueue.h" #include "plugins.h" #include "printing.h" +#include "geanyobject.h" #ifdef HAVE_SOCKET # include "socket.h" @@ -924,6 +925,9 @@ gint main(gint argc, gchar **argv) gtk_major_version, gtk_minor_version, gtk_micro_version, glib_major_version, glib_minor_version, glib_micro_version); + /* create the object so Geany signals can be connected in init() functions */ + geany_object = geany_object_new(); + /* inits */ main_init(); gtk_widget_set_size_request(main_widgets.window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT); @@ -1124,6 +1128,9 @@ void main_quit() if (msgwindow.popup_compiler_menu && GTK_IS_WIDGET(msgwindow.popup_compiler_menu)) gtk_widget_destroy(msgwindow.popup_compiler_menu); + g_object_unref(geany_object); + geany_object = NULL; + g_free(app); gtk_main_quit(); diff --git a/src/plugins.c b/src/plugins.c index 01a395ed..d908f540 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -820,7 +820,6 @@ void plugins_init() GtkWidget *widget; geany_data_init(); - geany_object = geany_object_new(); widget = gtk_separator_menu_item_new(); gtk_widget_show(widget); @@ -910,9 +909,6 @@ void plugins_free(void) g_list_free(active_plugin_list); } g_strfreev(active_plugins_pref); - - g_object_unref(geany_object); - geany_object = NULL; /* to mark the object as invalid for any code which tries to emit signals */ }