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
This commit is contained in:
Nick Treleaven 2008-11-21 17:27:16 +00:00
parent 205070f5c0
commit e6fa252184
3 changed files with 10 additions and 4 deletions

View File

@ -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 <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -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();

View File

@ -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 */
}