summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f358fb0)
raw | patch | inline | side by side (parent: f358fb0)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jan 2008 20:50:00 +0000 (20:50 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 17 Jan 2008 20:50:00 +0000 (20:50 +0000) |
src/desktop.cpp | patch | blob | history | |
src/sp-namedview.cpp | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index e52d2b50c2a7c1f95e2c669e8a53456a36d3111b..9498d539910940307901fb5ac8177430850cdf5f 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
void SPDesktop::destroy()
{
+ namedview->hide(this);
+
_activate_connection.disconnect();
_deactivate_connection.disconnect();
_sel_modified_connection.disconnect();
bool SPDesktop::onDeleteUI (GdkEventAny*)
{
- if(shutdown()) return true;
- destroyWidget();
- return false;
+ if(shutdown())
+ return true;
+
+ destroyWidget();
+ return false;
}
/**
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 481f201cdf97bfbec737cd158114f33767348388..d26f0052963b437e1ecf13f9ff8d3091babad214 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
// delete grids:
while ( namedview->grids ) {
- Inkscape::CanvasGrid *gr = (Inkscape::CanvasGrid *)namedview->grids->data;
+ Inkscape::CanvasGrid *gr = (Inkscape::CanvasGrid *)namedview->grids->data; // get first entry
delete gr;
- namedview->grids = g_slist_remove_link(namedview->grids, namedview->grids);
+ namedview->grids = g_slist_remove_link(namedview->grids, namedview->grids); // deletes first entry
}
if (((SPObjectClass *) parent_class)->release) {
@@ -575,6 +575,10 @@ sp_namedview_add_grid(SPNamedView *nv, Inkscape::XML::Node *repr, SPDesktop *des
doc = sp_desktop_document(desktop);
else
doc = sp_desktop_document(static_cast<SPDesktop*>(nv->views->data));
+ if (!doc) {
+ g_warning("sp_namedview_add_grid - how come doc is null here?!");
+ return NULL;
+ }
grid = Inkscape::CanvasGrid::NewGrid(nv, repr, doc, gridtype);
nv->grids = g_slist_append(nv->grids, grid);
//Initialize the snapping parameters for the new grid
}
views = g_slist_remove(views, desktop);
-
- // delete grids:
- while ( grids ) {
- Inkscape::CanvasGrid *gr = (Inkscape::CanvasGrid *)grids->data;
- delete gr;
- grids = g_slist_remove_link(grids, grids);
- }
}
void SPNamedView::activateGuides(gpointer desktop, gboolean active)