Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

wxWidgets question

Name: Anonymous 2008-09-22 12:05

Currently, my OnInit() function look like this:


{
    MainFrame *main = new MainFrame();

    main->Show(true);
    SetTopWindow(main);

    return true;
}


Concerned that there was probably a technical memory leak here, I moved MainFrame *main to private, and added an OnExit:


{
    delete main;
    return 0;
}


But when I do this, I get an access violation on closing. What's wrong with my code, /prog/?

Name: Anonymous 2008-09-22 17:22

>>5
It will. Don't worry about it.

Also your debugger should tell you if there are memory leaks, at least with some option. I code wxWidgets on VC++ and it does so by default, I think with the express version you have to add a few statements in your code. No clue about gdb etc.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List