HomeWildfire Games

Encapsulate runtime creation.

Description

Encapsulate runtime creation.

  • Makes it easier to change down the line (and change is coming)
  • Allows making g_ScriptRuntime thread-local easily.
  • Remove ParentRuntime, which is not used at the moment.

Part of the SM52 migration, stage: SM45 compatible.

Patch by: Itms

Tested By: Freagarach

Refs #4893

Differential Revision: https://code.wildfiregames.com/D3087

Event Timeline

vladislavbelov added inline comments.
/ps/trunk/source/ps/GameSetup/GameSetup.cpp
112

Why it should be shared_ptr if it's thread_local?

/ps/trunk/source/scriptinterface/ScriptInterface.h
57

Sounds like a workaround, should be fixed.

/ps/trunk/source/scriptinterface/ScriptRuntime.cpp
94

That's the unsafe creation of std::shared_ptr, should be std::make_shared instead.

wraitii added inline comments.Nov 13 2020, 3:17 PM
/ps/trunk/source/ps/GameSetup/GameSetup.cpp
112

As you write below, this is more or less a workaround. I plan to fix it downstream.