Core: Change thread startCallback semantics to before reset
Vicki Pfau vi@endrift.com
Fri, 04 Aug 2017 08:17:35 -0700
2 files changed,
9 insertions(+),
8 deletions(-)
M
src/core/thread.c
→
src/core/thread.c
@@ -158,7 +158,6 @@ .context = threadContext
}; core->addCoreCallbacks(core, &callbacks); core->setSync(core, &threadContext->impl->sync); - core->reset(core); struct mLogFilter filter; if (!threadContext->logger.d.filter) {@@ -168,12 +167,13 @@ mLogFilterLoad(threadContext->logger.d.filter, &core->config);
} mCoreThreadRewindParamsChanged(threadContext); + if (threadContext->startCallback) { + threadContext->startCallback(threadContext); + } + core->reset(core); _changeState(threadContext->impl, THREAD_RUNNING, true); - if (threadContext->startCallback) { - threadContext->startCallback(threadContext); - } if (threadContext->resetCallback) { threadContext->resetCallback(threadContext); }
M
src/platform/qt/CoreController.cpp
→
src/platform/qt/CoreController.cpp
@@ -66,10 +66,6 @@ controller->m_override->identify(context->core);
controller->m_override->apply(context->core); } - if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) { - mCoreDeleteState(context->core, 0); - } - if (controller->m_multiplayer) { controller->m_multiplayer->attachGame(controller); }@@ -82,6 +78,11 @@ CoreController* controller = static_cast<CoreController*>(context->userData);
for (auto action : controller->m_resetActions) { action(); } + + if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) { + mCoreDeleteState(context->core, 0); + } + controller->m_resetActions.clear(); QSize size = controller->screenDimensions();