Specially with the situation at src/HexEditorFrame.cpp:498
Status: Beta
Brought to you by:
erdem_ua
Hello,
I've done some wxWidgets development at past. I can't say this is a problem with wxWidgets library but please try:
Instead of creating dialog at heap, Could you please create it at stack?
Use:
else if( event.GetId() == idCompare ){
CompareDialog mcd(this);
mcd.ShowModal();
mcd.Destroy();
}
Instead of:
else if( event.GetId() == idCompare ){
::CompareDialog *mcd = new CompareDialog( this );
mcd->ShowModal();
mcd->Destroy();
}
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
At dialog code of wxWidgets at wxWidgets doc is more clear:
Create dialog at stack and don't use destroy function:
http://docs.wxwidgets.org/stable/wx_wxdialog.html
No, it doesn't work If I remember correctly.
You can't call mcs.Destroy() normally or segmentation fault.
I use this functions like that before. But as soon as current function returns, mcd destroyed automatically and lead same error...
Somehow, MacOSX looks like destroy my class at the end of the ShowModal(), without using Destroy() code.
It happens at some other function too.
Actually Linux has same habit, before increasing stack size to 32MB from 8MB.
I can't find how to increase stack on program manually, But increasing stack by hand via "ulimit -s 32000" doesn't help.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Could you please look my previous post?
http://docs.wxwidgets.org/stable/wx_wxdialog.html
I already.
Use of:
else if( event.GetId() == idCompare ){
CompareDialog mcd(this);
mcd.ShowModal();
} <-Segmentation Fault HERE due destructor
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
What is your version of wxWidgets?
It doesn't differ. Same for 2.8.12 and 2.9.3
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I've implemented differently before. When ShowModal function called it is returning an id: keep this id private int in class at the end call endmodal as:
dialogid is an int number that returns from ShowModal.
model->EndModal(dialogid);
I can send source code of application if you want.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
For example:
class MyDialog : public wxDialog {
//I didn't write constructor implementation
void setID(int id) {dialogid=id;}
private:
int dialogid
};
Lets create our dialog:
MyDialog dialog(this);
dialog.setID(dialog.ShowModal());
When we finish our work with modal or at another function.
We call at end:
this->EndModal(dialogid);
this->EndModal is implemented in MyDialog function
I attached picture about error.
It tries to free already freed memory.
Also ShowModal returns the values like wxOK wxCANCEL... when dialog is closed.
EndModal just passing it parameter to ShowModal actually. I don't understand how could it fix this issue.
it's nothing to do with memory pointers. I believe this is something related with compiler / MacOSX instead of my my code.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Maybe it is MacOS issue releated with wxWidgets:
You can report the bug:
http://trac.wxwidgets.org/
I haven't a Mac so I can't prove why it is not working.
Anyway, I have a good working work a round.
This might be an also some Kernel issue.
Filling a bug to track is not something that I want because same code doesn't popup same issue before.
I cannot produce "minimal sample" of this bug.
Anyway, I doesn't hold me releasing new version. But added countless features.
Now just fixing some broken parts and adding more features until last day of Feb which is new version comes..