From: gouldtj Date: Tue, 2 May 2006 05:25:27 +0000 (+0000) Subject: r11463@tres: ted | 2006-04-19 08:28:18 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=08e70190b42aab4b9088dc5b0fe04f7374375faa;p=inkscape.git r11463@tres: ted | 2006-04-19 08:28:18 -0700 Making GTK+ manage all the memory that I thought it was already doing before. Now new GTK+ objects that aren't internally referenced are surrounded by Gtk::manage() --- diff --git a/src/extension/error-file.cpp b/src/extension/error-file.cpp index 4f6987930..d6239b1a1 100644 --- a/src/extension/error-file.cpp +++ b/src/extension/error-file.cpp @@ -56,7 +56,7 @@ ErrorFileNotice::ErrorFileNotice (void) : Gtk::VBox * vbox = get_vbox(); /* This is some filler text, needs to change before relase */ - checkbutton = new Gtk::CheckButton(_("Show dialog on startup")); + checkbutton = Gtk::manage(new Gtk::CheckButton(_("Show dialog on startup"))); vbox->pack_start(*checkbutton, true, false, 5); checkbutton->show(); checkbutton->set_active(prefs_get_int_attribute(PREFERENCE_ID, 1) == 0 ? false : true); @@ -65,7 +65,6 @@ ErrorFileNotice::ErrorFileNotice (void) : set_resizable(true); - //Gtk::HPaned *splitter = new Gtk::HPaned(); Inkscape::UI::Dialogs::ExtensionsPanel* extens = new Inkscape::UI::Dialogs::ExtensionsPanel(); extens->set_full(false); vbox->pack_start( *extens, true, true ); diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 7004e848f..e41990a1c 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -594,8 +594,7 @@ Extension::autogui (void) { if (g_slist_length(parameters) == 0) return NULL; - Gtk::VBox * vbox = new Gtk::VBox(); - vbox = new Gtk::VBox(); + Gtk::VBox * vbox = Gtk::manage(new Gtk::VBox()); for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) { Parameter * param = reinterpret_cast(list->data); diff --git a/src/extension/parameter.cpp b/src/extension/parameter.cpp index 57bc98fcc..59d6ee09c 100644 --- a/src/extension/parameter.cpp +++ b/src/extension/parameter.cpp @@ -593,14 +593,14 @@ ParamIntAdjustment::val_changed (void) Gtk::Widget * ParamFloat::get_widget (void) { - Gtk::HBox * hbox = new Gtk::HBox(); + Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox()); - Gtk::Label * label = new Gtk::Label(_(_text), Gtk::ALIGN_LEFT); + Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT)); label->show(); hbox->pack_start(*label, true, true); ParamFloatAdjustment * fadjust = new ParamFloatAdjustment(this); - Gtk::SpinButton * spin = new Gtk::SpinButton(*fadjust, 0.1, 1); + Gtk::SpinButton * spin = Gtk::manage(new Gtk::SpinButton(*fadjust, 0.1, 1)); spin->show(); hbox->pack_start(*spin, false, false); @@ -617,14 +617,14 @@ ParamFloat::get_widget (void) Gtk::Widget * ParamInt::get_widget (void) { - Gtk::HBox * hbox = new Gtk::HBox(); + Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox()); - Gtk::Label * label = new Gtk::Label(_(_text), Gtk::ALIGN_LEFT); + Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT)); label->show(); hbox->pack_start(*label, true, true); ParamIntAdjustment * fadjust = new ParamIntAdjustment(this); - Gtk::SpinButton * spin = new Gtk::SpinButton(*fadjust, 1.0, 0); + Gtk::SpinButton * spin = Gtk::manage(new Gtk::SpinButton(*fadjust, 1.0, 0)); spin->show(); hbox->pack_start(*spin, false, false); @@ -676,9 +676,9 @@ ParamBoolCheckButton::on_toggle (void) Gtk::Widget * ParamBool::get_widget (void) { - Gtk::HBox * hbox = new Gtk::HBox(); + Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox()); - Gtk::Label * label = new Gtk::Label(_(_text), Gtk::ALIGN_LEFT); + Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT)); label->show(); hbox->pack_start(*label, true, true); @@ -730,9 +730,9 @@ ParamStringEntry::changed_text (void) Gtk::Widget * ParamString::get_widget (void) { - Gtk::HBox * hbox = new Gtk::HBox(); + Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox()); - Gtk::Label * label = new Gtk::Label(_(_text), Gtk::ALIGN_LEFT); + Gtk::Label * label = Gtk::manage(new Gtk::Label(_(_text), Gtk::ALIGN_LEFT)); label->show(); hbox->pack_start(*label, true, true);