]> git.tokkee.org Git - inkscape.git/commitdiff

Code

r11463@tres: ted | 2006-04-19 08:28:18 -0700
authorgouldtj <gouldtj@users.sourceforge.net>
Tue, 2 May 2006 05:25:27 +0000 (05:25 +0000)
committergouldtj <gouldtj@users.sourceforge.net>
Tue, 2 May 2006 05:25:27 +0000 (05:25 +0000)
 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()

src/extension/error-file.cpp
src/extension/extension.cpp
src/extension/parameter.cpp

index 4f6987930beebf2423038a01151f716bbfb31b8e..d6239b1a14b9aa60f0486196f408da3e631f0026 100644 (file)
@@ -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 );
index 7004e848f2c1ab41e22b2e3d00b2bc7622decd31..e41990a1c9153e8c746f25dcfeec3261ebcd5a8a 100644 (file)
@@ -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<Parameter *>(list->data);
index 57bc98fcc55c04043d99297464a4b7b19d9446df..59d6ee09c8b0042ee845e6646d06dc838b09b876 100644 (file)
@@ -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);