Skip to content

Commit

Permalink
Core: Change thread startCallback semantics to before reset
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Aug 4, 2017
1 parent 1a74924 commit 41e0014
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
};
core->addCoreCallbacks(core, &callbacks);
core->setSync(core, &threadContext->impl->sync);
core->reset(core);

struct mLogFilter filter;
if (!threadContext->logger.d.filter) {
Expand All @@ -168,12 +167,13 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
}

mCoreThreadRewindParamsChanged(threadContext);

_changeState(threadContext->impl, THREAD_RUNNING, true);

if (threadContext->startCallback) {
threadContext->startCallback(threadContext);
}

core->reset(core);
_changeState(threadContext->impl, THREAD_RUNNING, true);

if (threadContext->resetCallback) {
threadContext->resetCallback(threadContext);
}
Expand Down
9 changes: 5 additions & 4 deletions src/platform/qt/CoreController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ CoreController::CoreController(mCore* core, QObject* parent)
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);
}
Expand All @@ -82,6 +78,11 @@ CoreController::CoreController(mCore* core, QObject* parent)
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();
Expand Down

0 comments on commit 41e0014

Please sign in to comment.