Some fixes for memory leaks, issue #657

Added Gtk:manage() on widgets and some destructors.
This commit is contained in:
ffsup2
2011-05-09 23:37:25 +02:00
parent 47ba6a6dd5
commit dacf453c54
25 changed files with 319 additions and 299 deletions

View File

@@ -53,7 +53,7 @@ RTWindow::RTWindow () {
mainNB->set_scrollable (true);
mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) );
fpanel = new FilePanel ();
fpanel = Gtk::manage ( new FilePanel () );
fpanel->setParent (this);
// decorate tab
@@ -62,7 +62,7 @@ RTWindow::RTWindow () {
Gtk::VBox* vbf = Gtk::manage (new Gtk::VBox ());
vbf->pack_start (*Gtk::manage (new Gtk::Image (Gtk::Stock::DIRECTORY, Gtk::ICON_SIZE_MENU)));
Gtk::Label* l=new Gtk::Label (Glib::ustring(" ") + M("MAIN_FRAME_FILEBROWSER"));
Gtk::Label* l= Gtk::manage(new Gtk::Label (Glib::ustring(" ") + M("MAIN_FRAME_FILEBROWSER")));
l->set_angle (90);
vbf->pack_start (*l);
vbf->set_spacing (2);
@@ -77,22 +77,22 @@ RTWindow::RTWindow () {
mainNB->append_page (*fpanel, *hbf);
}
bpanel = new BatchQueuePanel ();
bpanel = Gtk::manage ( new BatchQueuePanel () );
bpanel->setParent (this);
// decorate tab, the label is unimportant since its updated in batchqueuepanel anyway
Gtk::Label* lbq = new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE"));
Gtk::Label* lbq = Gtk::manage ( new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE")) );
mainNB->append_page (*bpanel, *lbq);
// epanel is only for single tab mode
epanel = new EditorPanel (fpanel);
epanel = Gtk::manage ( new EditorPanel (fpanel) );
epanel->setParent (this);
// decorate tab
if (options.mainNBVertical) {
Gtk::VBox* vbe = Gtk::manage (new Gtk::VBox ());
vbe->pack_start (*Gtk::manage (new Gtk::Image (argv0+"/images/logoicon16.png")));
Gtk::Label* l=new Gtk::Label( Glib::ustring(" ") + M("MAIN_FRAME_EDITOR") );
Gtk::Label* l=Gtk::manage (new Gtk::Label( Glib::ustring(" ") + M("MAIN_FRAME_EDITOR") ));
//l->set_markup(Glib::ustring("<b>Editor</b>")); Bold difficult to read
l->set_angle (90);
vbe->pack_start (*l);