Fix segfault-on-emu_stop() bug.

This commit is contained in:
practicalswift 2015-11-03 14:34:31 +01:00
parent 696c58f9f0
commit 4151d1d600

6
uc.c
View File

@ -525,8 +525,10 @@ uc_err uc_emu_stop(uc_engine *uc)
return UC_ERR_OK;
uc->stop_request = true;
// exit the current TB
cpu_exit(uc->current_cpu);
if (uc->current_cpu) {
// exit the current TB
cpu_exit(uc->current_cpu);
}
return UC_ERR_OK;
}