diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-11-23 14:41:21 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-11-23 14:41:21 -0300 |
commit | aa56c7b79317fb88c12fc0573fc23b6939337fe4 (patch) | |
tree | d13cf7c507530260dccd35f6a207b4dcd3b8a313 /libqmenumodel/src/qdbusmenumodel.cpp | |
parent | af103ebfb8945c903accb42944516d234fe5744c (diff) | |
download | qmenumodel-aa56c7b79317fb88c12fc0573fc23b6939337fe4.tar.gz qmenumodel-aa56c7b79317fb88c12fc0573fc23b6939337fe4.tar.bz2 qmenumodel-aa56c7b79317fb88c12fc0573fc23b6939337fe4.zip |
Take care of object ref internally on QMenumodel, instead of QDBusMenuModel.
Diffstat (limited to 'libqmenumodel/src/qdbusmenumodel.cpp')
-rw-r--r-- | libqmenumodel/src/qdbusmenumodel.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libqmenumodel/src/qdbusmenumodel.cpp b/libqmenumodel/src/qdbusmenumodel.cpp index d3369dd..abf259f 100644 --- a/libqmenumodel/src/qdbusmenumodel.cpp +++ b/libqmenumodel/src/qdbusmenumodel.cpp @@ -89,11 +89,7 @@ void QDBusMenuModel::stop() /*! \internal */ void QDBusMenuModel::serviceVanish(GDBusConnection *) { - GMenuModel *model = menuModel(); - if (model != NULL) { - setMenuModel(NULL); - g_object_unref(model); - } + setMenuModel(NULL); } /*! \internal */ @@ -105,6 +101,9 @@ void QDBusMenuModel::serviceAppear(GDBusConnection *connection) setMenuModel(model); if (model == NULL) { stop(); + } else { + //setModel take care of the ref + g_object_unref(model); } } |