diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2011-07-30 18:50:46 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2011-07-30 18:50:46 +0000 |
| commit | 7c08a0a0c893ca60e6844871e671ead34bf09edb (patch) | |
| tree | 8102e59df0014f2c3700cf489d28245cca8c1b05 /src | |
| parent | German translation update (diff) | |
| download | inkscape-7c08a0a0c893ca60e6844871e671ead34bf09edb.tar.gz inkscape-7c08a0a0c893ca60e6844871e671ead34bf09edb.zip | |
Memory leaks fix / code cleanup
(bzr r10519)
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop.cpp | 3 | ||||
| -rw-r--r-- | src/dialogs/text-edit.cpp | 1 | ||||
| -rw-r--r-- | src/display/nr-filter-gaussian.cpp | 2 | ||||
| -rw-r--r-- | src/document.cpp | 11 |
4 files changed, 14 insertions, 3 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 5e968b08b..bef4ad8cd 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1698,6 +1698,9 @@ static void _reconstruction_start (SPDesktop * desktop) { // printf("Desktop, starting reconstruction\n"); + if (desktop->_reconstruction_old_layer_id){ + g_free(desktop->_reconstruction_old_layer_id); + } desktop->_reconstruction_old_layer_id = g_strdup(desktop->currentLayer()->getId()); desktop->_layer_hierarchy->setBottom(desktop->currentRoot()); diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index ce3165632..382b1d630 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -752,6 +752,7 @@ sp_text_edit_dialog_read_selection ( GtkWidget *dlg, gtk_text_buffer_set_text (tb, str, strlen (str)); gtk_text_buffer_set_modified (tb, FALSE); } + g_free(phrase); phrase = str; } else { diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp index 3a6b425e1..d240c1a43 100644 --- a/src/display/nr-filter-gaussian.cpp +++ b/src/display/nr-filter-gaussian.cpp @@ -226,7 +226,6 @@ static void calcFilter(double const sigma, double b[N]) { double qbeg = 1; // Don't go lower than sigma==2 (we'd probably want a normal convolution in that case anyway) double qend = 2*sigma; double const sigmasqr = sqr(sigma); - double s; do { // Binary search for right q (a linear interpolation scheme is suggested, but this should work fine as well) double const q = (qbeg+qend)/2; // Compute scaled filter coefficients @@ -239,7 +238,6 @@ static void calcFilter(double const sigma, double b[N]) { } else { qend = q; } - s = sqrt(ssqr); } while(qend-qbeg>(sigma/(1<<30))); // Compute filter coefficients double const q = (qbeg+qend)/2; diff --git a/src/document.cpp b/src/document.cpp index 5bcf1bf40..441a5876f 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -312,6 +312,15 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, document->rdoc = rdoc; document->rroot = rroot; + if (document->uri){ + g_free(document->uri); + } + if (document->base){ + g_free(document->base); + } + if (document->name){ + g_free(document->name); + } #ifndef WIN32 document->uri = prepend_current_dir_if_relative(uri); #else @@ -503,7 +512,7 @@ SPDocument *SPDocument::createNewDocFromMem(gchar const *buffer, gint length, un name = g_strdup_printf(_("Memory document %d"), ++doc_count); doc = createDoc(rdoc, NULL, NULL, name, keepalive); - + g_free(name); return doc; } |
