Fix:core:Preventing segfault on exit when the config file has no graphics or gui set
authorsteven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 8 Feb 2009 04:41:31 +0000 (04:41 +0000)
committersteven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 8 Feb 2009 04:41:31 +0000 (04:41 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2029 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c

index 08467d5..ff4a2b2 100644 (file)
@@ -2039,11 +2039,14 @@ navit_destroy(struct navit *this_)
        callback_destroy(this_->roadbook_callback);
        callback_destroy(this_->popup_callback);
        callback_destroy(this_->motion_timeout_callback);
-       graphics_remove_callback(this_->gra, this_->resize_callback);
+       if(this_->gra)
+         graphics_remove_callback(this_->gra, this_->resize_callback);
        callback_destroy(this_->resize_callback);
-       graphics_remove_callback(this_->gra, this_->button_callback);
+       if(this_->gra)
+         graphics_remove_callback(this_->gra, this_->button_callback);
        callback_destroy(this_->button_callback);
-       graphics_remove_callback(this_->gra, this_->motion_callback);
+       if(this_->gra)
+         graphics_remove_callback(this_->gra, this_->motion_callback);
        callback_destroy(this_->motion_callback);
        g_free(this_);
 }