Hi,
I have a simple file dialog, as given in the dialogs.cpp example.
The problem is that when I try to show the dialog, sometimes it crashes, sometimes not. If it is shown and I try to change the directory - again, random crashes and random success.
So at all from 10 executions, I am able to select the file I wish to only once.
Any ideas?
P.S.
I am using wxWidgets 2.6.2 compiled with gcc.3.3.5 on Mandriva 2006.
I can not use other compiler, because I use a library, which come precompiled with gcc.3.3.5
wxFileDialog segmentation fault
Here is the code
All the variables are declared and there is no problem with them.
I was just wondering whether I should use some specific options with the configure script.
I have used the following:
./configure --with-gtk --disable-precompiled headers
Code: Select all
void ONS_Panel::FileBrowser(wxCommandEvent &event)
{
wxString _message;
switch (event.GetId())
{
case ID_BUTTON_NETWORK_TOPOLOGY:
{
_message=_T("Choose a Network Topology File ...");
}
break;
case ID_BUTTON_NETWORK_DEMAND:
{
_message=_T("Choose a Network Demand File ...");
}
break;
}
wxFileDialog *fileDialog = new wxFileDialog(_parentFrame, _message, wxGetCwd(), wxEmptyString, _T("GML files (*.gml)|*.gml|All Files (*.*)|*.*"));
fileDialog->CentreOnParent();
int _pathLength = wxGetCwd().Length();
if (fileDialog->ShowModal() == wxID_OK )
{
switch (event.GetId())
{
case ID_BUTTON_NETWORK_TOPOLOGY:
{
_fileNetworkTopology->Clear();
wxString info = fileDialog->GetPath();
_fileNetworkTopology->WriteText(info.SubString(_pathLength+1,info.Length()));
}
break;
case ID_BUTTON_NETWORK_DEMAND:
{
_fileNetworkDemand->Clear();
wxString info = fileDialog->GetPath();
_fileNetworkDemand->WriteText(info.SubString(_pathLength+1,info.Length()));
}
break;
}
}
}
I was just wondering whether I should use some specific options with the configure script.
I have used the following:
./configure --with-gtk --disable-precompiled headers
I'm running into the same problem on a Gentoo Linux system. In fact, I see the crash every time I try to open a wxFileDialog on any application, not just the ones that I create. This goes for dialogblocks and audacity as well as my own code.
I've logged a bug (number 1440312) on the issue, but so far there has been no activity. I've also tried to step through the code to see if I can find out what's going wrong, but the segfault doesn't happen when I step through the wxFileDialog code, so it's probably a timing issue.
Has anyone else run into this problem?
Thanks,
Steve
I've logged a bug (number 1440312) on the issue, but so far there has been no activity. I've also tried to step through the code to see if I can find out what's going wrong, but the segfault doesn't happen when I step through the wxFileDialog code, so it's probably a timing issue.
Has anyone else run into this problem?
Thanks,
Steve
-
- Can't get richer than this
- Posts: 802
- Joined: Mon Dec 27, 2004 10:46 am
- Location: Estonia, Tallinn
- Contact:
I simply could never reproduce this. Neither bug 1287999 or your reported one.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
well maybe it's something completely different, but I had problems with wxFileDialogs on Debian Sarge. Usually my app freezed, when I'd tried to create a wxFileDialog, but sometimes not... I remembered that in the "past" it worked fine. The difference between past and present was in some system updates, kernell recompiles etc., so I've decided to recompile wxGTK again and now it seems that it works fine again...that's all I can say about this problem:)sglow wrote:I'm running into the same problem on a Gentoo Linux system. In fact, I see the crash every time I try to open a wxFileDialog on any application, not just the ones that I create. This goes for dialogblocks and audacity as well as my own code.
I've logged a bug (number 1440312) on the issue, but so far there has been no activity. I've also tried to step through the code to see if I can find out what's going wrong, but the segfault doesn't happen when I step through the wxFileDialog code, so it's probably a timing issue.
Has anyone else run into this problem?
Thanks,
Steve
...I have to learn a lot about Linux and wxWidgets...
running Debian Sarge on IBM ThinkPad R50e PM1,6, trying to develop one crossplatform app for documentation management
running Debian Sarge on IBM ThinkPad R50e PM1,6, trying to develop one crossplatform app for documentation management