[maemo-commits] [maemo-commits] r8911 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Jan 2 17:22:17 EET 2007
- Previous message: [maemo-commits] r8910 - projects/haf/branches/maemo-af-desktop/hildon-desktop
- Next message: [maemo-commits] r8912 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: lucasr Date: 2007-01-02 17:22:16 +0200 (Tue, 02 Jan 2007) New Revision: 8911 Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-python.c Log: 2007-01-02 Lucas Rocha <lucas.rocha at nokia.com> * src/hd-plugin-loader-python.c: fix crash when loading and then unloading a python plugin. Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog =================================================================== --- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog 2007-01-02 13:45:33 UTC (rev 8910) +++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog 2007-01-02 15:22:16 UTC (rev 8911) @@ -1,5 +1,10 @@ 2007-01-02 Lucas Rocha <lucas.rocha at nokia.com> + * src/hd-plugin-loader-python.c: fix crash when loading and then + unloading a python plugin. + +2007-01-02 Lucas Rocha <lucas.rocha at nokia.com> + * configure.ac: fix package name for l10n reasons. 2006-12-29 Lucas Rocha <lucas.rocha at nokia.com> @@ -15,8 +20,8 @@ Support for python plugins. - * src/hd-plugin-loader-factory.[ch]: plugin loader for python plugins. - * src/hd-plugin-loader-factory.[cg]: added python plugin loader. + * src/hd-plugin-loader-python.[ch]: plugin loader for python plugins. + * src/hd-plugin-loader-factory.[ch]: added python plugin loader. * src/Makefile.am: update to get new files into the build process. * configure.ac: complete reorganization and python checks added. Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-python.c =================================================================== --- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-python.c 2007-01-02 13:45:33 UTC (rev 8910) +++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-plugin-loader-python.c 2007-01-02 15:22:16 UTC (rev 8911) @@ -91,14 +91,13 @@ if (pModule == NULL) { pModule = PyImport_ImportModule (module_name); - + if (pModule == NULL) { PyErr_Print (); PyErr_Clear (); - g_warning ("Could not initialize Python module '%s'", - module_name); + g_warning ("Could not initialize Python module '%s'", module_name); } } else @@ -116,7 +115,7 @@ } else { - Py_DECREF (pReload); + Py_DECREF(pReload); } } @@ -126,7 +125,7 @@ pFunc = PyDict_GetItemString (pDict, "hd_plugin_get_objects"); - if (pFunc && PyCallable_Check (pFunc)) + if (pFunc != NULL && PyCallable_Check (pFunc)) { pList = PyObject_CallObject (pFunc, NULL); @@ -141,22 +140,25 @@ /* FIXME: add type checking here */ if (pObject != NULL) { - objects = g_list_append (objects, ((PyGObject *) pObject)->obj); + GObject *object = g_object_ref(((PyGObject *) pObject)->obj); + + objects = g_list_append (objects, object); } } + + Py_DECREF(pList); } else { - Py_DECREF(pList); - Py_DECREF(pFunc); - Py_DECREF(pModule); + Py_XDECREF(pList); + Py_DECREF(pModule); - PyErr_Print (); - PyErr_Clear (); + PyErr_Print (); + PyErr_Clear (); - g_warning ("hd_plugin_get_objects call failed in python module"); + g_warning ("Failed to call hd_plugin_get_objects in python module"); - return NULL; + return NULL; } } else @@ -167,18 +169,15 @@ PyErr_Clear (); } - g_warning ("Cannot find function \"%s\"\n", "hd_plugin_get_objects"); + g_warning ("Cannot find function \"%s\"", "hd_plugin_get_objects"); } - - Py_XDECREF(pFunc); - Py_DECREF(pModule); } else { PyErr_Print (); PyErr_Clear (); - g_warning ("Failed to load \"%s\"\n", module_name); + g_warning ("Failed to load \"%s\"", module_name); } g_free (module_name);
- Previous message: [maemo-commits] r8910 - projects/haf/branches/maemo-af-desktop/hildon-desktop
- Next message: [maemo-commits] r8912 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]