Hi,
sorry for the late Reply and thanks for the suggestions:
ONEEYEMAN wrote: ↑Wed Jul 01, 2020 1:52 pm
Hi,
Are you trying to call wxExecute() from a thread?
Try to execute those scripts one by one
Thank you.
I'm calling the script one by one in the main thread, usually I'm binding the process to an event handler, and there I check the result of the script.
I'm usually launch 30 + script at the same time, maybe it is the problem they are too much.
doublemax wrote: ↑Wed Jul 01, 2020 4:15 pm
That usually means that the crash happens before wxApp::OnInit() is called. Can you confirm that?
If yes, check if you have any global variables that use wxWidgets classes. These are constructed before wxWidgets itself is initialized, which can cause all kind of problems (= don't do this).
Hi doublemax,
the program start fine, actually the scripts don't start until I press a button.
Here the snipped code where I call the scipts:
Code: Select all
bool DevCollectorFrame::CallScript(wxString sIP, int id)
{
if(sIP==_(""))
return false;
wxString cmd = _("home/user/pydev/py36-venv/bin/python3 /home/user/Documents/Scripts/dev_col.py ") + sIP;
wxProcess *ObjProcess = new wxProcess(this,id);
ObjProcess->Bind(wxEVT_END_PROCESS ,&DevCollectorFrame::HandlerEndScriptRequest,this);
int pidProcess = wxExecute(cmd,32,ObjProcess);
if ( pidProcess != -1 )
{
wxString sDebug=_("\n-Started script for ")+sIP;
TextDebug->AppendText(sDebug);
return true;
}//fine if
else
{
return false;
}
}
I cleared the code a bit for readability.
I call the scripts every 10 min, do I need to clear the Bind Event?
Thanks you for the help,
Best Regards,
Nicola.