summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/global.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/global.c b/src/core/global.c
index 2deb9f7..b227a5d 100644
--- a/src/core/global.c
+++ b/src/core/global.c
@@ -95,13 +95,16 @@ void set_current_project(GStudyProject *project)
{
if (_project != NULL)
{
- _project_notify(_project, false);
+ if (_project_notify != NULL)
+ _project_notify(_project, false);
+
g_object_unref(G_OBJECT(_project));
+
}
_project = project;
- if (_project != NULL)
+ if (_project != NULL && _project_notify != NULL)
_project_notify(_project, true);
}