delete hDrawEmu;
}
if(hRunEmu != NULL) {
+ hRunEmu->quit();
hRunEmu->wait();
delete hRunEmu;
}
emu->stop_record_video();
emu->now_debugging = true;
connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(doExit()));
+ connect(this, SIGNAL(destroyed()), emu->hDebugger, SLOT(do_destroy_thread()));
//connect(this, SIGNAL(quit_debugger_thread()), emu->hDebugger, SLOT(close()));
connect(emu->hDebugger, SIGNAL(sig_finished()), this, SLOT(OnCloseDebugger()));
connect(emu->hDebugger, SIGNAL(sig_put_string(QString)), emu->hDebugger, SLOT(put_string(QString)));
#if defined(USE_DEBUGGER)
OSD *osd = debugger_thread_param.osd;
osd->do_set_input_string(text_command->text());
-// emit sig_call_debugger(text_command->text());
#endif
cmd_clear();
}
event->ignore();
}
+void CSP_Debugger::do_destroy_thread(void)
+{
+#if defined(USE_DEBUGGER)
+ if(main_thread != NULL) {
+ if(main_thread->isRunning()) {
+ main_thread->quit_debugger();
+ main_thread->terminate();
+ }
+ delete main_thread;
+ }
+ main_thread = NULL;
+#endif
+ this->close();
+}
+
CSP_Debugger::CSP_Debugger(QWidget *parent) : CSP_Debugger_Tmpl(parent)
{
#if defined(USE_DEBUGGER)
void doExit2(void);
void call_debugger(void);
void run(void);
+ void do_destroy_thread(void);
signals:
void sig_put_string(QString);
void sig_run_command(QString);