How can I kill child windows before exiting main window?



I wrote an application that creates main window from glade file, and it also dynamically generates child window in the same way. The child window class inherited from trackable class, and constructor of the class creates the child window widgets.

code: (at main window)
    Glib::RefPtr<Gnome::Glade::Xml> refXml;
    refXml = Gnome::Glade::Xml::create("./glade/childplayer.glade");
    m_pChild = new CChildWindow( refXml );

code:(at constructor of child window)
    refXml->get_widget("childwindow_main_frame", m_pWindow);
    .
    .
    .
   
The problem is when I quit the main window (by clicking "x" button) while child window is there,the application is crashed.

One thing I cannot understand is that even if I delete the child window instance, the child window is still there.  I guess it's related to mechanism which creates a window from glade file.
Any explanation regarding this?

How can safely kill the child window? By the way, if I close all child windows manually (again by clicking x button), the main window will not be crashed when it exits.

Thank you in advance!

Justin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]