MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / Unload

Method Unload

src/openrct2/scripting/Plugin.cpp:116–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void Plugin::Unload()
117{
118 if (!_context)
119 {
120 throw std::runtime_error("Plugin is not loaded");
121 }
122
123 JS_FreeContext(_context);
124 _context = nullptr;
125
126 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937, fixed in GCC13
127 #if defined(__GNUC__) && !defined(__clang__)
128 #pragma GCC diagnostic push
129 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
130 #endif
131 _metadata.Main = {};
132 #if defined(__GNUC__) && !defined(__clang__)
133 #pragma GCC diagnostic pop
134 #endif
135 _hasLoaded = false;
136}
137
138void Plugin::LoadCodeFromFile()
139{

Callers 3

RegisterPluginMethod · 0.45
UnloadPluginMethod · 0.45
UpdateRideTypeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected