# HG changeset patch # User Sadrul Habib Chowdhury # Date 1205806404 0 # Node ID 2ded253bcdbb11e1b573171cfe630b2ccc0971de # Parent 22fef6b952a0587c95280d4f65f0f3c1d0e17604 Uninitialize the python interpreter only if gnt started it. This fixes a crash when quitting pygnt apps. diff -r 22fef6b952a0 -r 2ded253bcdbb finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Mon Mar 17 20:32:02 2008 +0000 +++ b/finch/libgnt/gntwm.c Tue Mar 18 02:13:24 2008 +0000 @@ -101,6 +101,7 @@ static gboolean idle_update; static GList *act = NULL; /* list of WS with unseen activitiy */ static gboolean ignore_keys = FALSE; +static gboolean started_python = FALSE; static GList * g_list_bring_to_front(GList *list, gpointer data) @@ -1342,7 +1343,10 @@ wm->workspaces = g_list_delete_link(wm->workspaces, wm->workspaces); } #ifdef USE_PYTHON - Py_Finalize(); + if (started_python) { + Py_Finalize(); + started_python = FALSE; + } #endif } @@ -1523,8 +1527,11 @@ #ifdef USE_PYTHON gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python, GNT_KEY_F3, NULL); - Py_SetProgramName("gnt"); - Py_Initialize(); + if (!Py_IsInitialized()) { + Py_SetProgramName("gnt"); + Py_Initialize(); + started_python = TRUE; + } #endif gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));