Code

Fix version check for wheel selector.
[inkscape.git] / src / profile-manager.cpp
index 19655e0a1b42a54eb7acb5724f40865e20021388..b70926947605ea5c8f14a06a5772e67c191c26de 100644 (file)
@@ -23,15 +23,19 @@ ProfileManager::ProfileManager(SPDocument *document) :
 
 ProfileManager::~ProfileManager()
 {
+    _resource_connection.disconnect();
+    _doc = 0;
 }
 
 void ProfileManager::_resourcesChanged()
 {
     std::vector<SPObject*> newList;
-    const GSList *current = sp_document_get_resource_list( _doc, "iccprofile" );
-    while ( current ) {
-        newList.push_back(SP_OBJECT(current->data));
-        current = g_slist_next(current);
+    if (_doc) {
+        const GSList *current = sp_document_get_resource_list( _doc, "iccprofile" );
+        while ( current ) {
+            newList.push_back(SP_OBJECT(current->data));
+            current = g_slist_next(current);
+        }
     }
     sort( newList.begin(), newList.end() );
 
@@ -92,4 +96,4 @@ ColorProfile* ProfileManager::find(gchar const* name)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :