Is memory freed automatically in wxWidgets?

When using wxWidgets, i am tempted to deallocate memory using delete in the destructor, but my programme crashes on closing.

I try to do something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class mainwnd:public wxFrame{
public:
  mainwnd():wxFrame(NULL,wxID_ANY,wxT("test")){
    menubar=new wxMenuBar;
    ...
}

  ~mainwnd(){
    if(menubar!=NULL)
      delete menubar;  //i think the problem is here!!!
  }
private:
  wxMenuBar *menubar;
};


Please can anyone tell me why? and is it done automatically?

Aceix.
Last edited on
Ummm... anyone?

Aceix.
Yeah thanks.

Aceix.
Topic archived. No new replies allowed.