Skip to content
Snippets Groups Projects
Commit 0edd1f1e authored by Florian Schmaus's avatar Florian Schmaus
Browse files

[ContextManager] Check if there is a current context before "freeing" it

parent 3b467421
No related branches found
No related tags found
1 merge request!338Add stack-usage stats
......@@ -51,8 +51,11 @@ void ContextManager::start() {
// We perform a longjmp with fibrilResumeValue == 0 to switch back
// to the original stack and terminate the runtime.
if (unlikely(!fibrilResumeValue && runtime.isTerminating())) {
putFreeContext(Context::currentContext);
Context::currentContext = nullptr;
Context* currentContext = Context::currentContext;
if (currentContext) [[likely]] {
Context::currentContext = nullptr;
putFreeContext(currentContext);
}
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment