diff options
| author | Alexander Gavrilov | 2012-08-23 19:51:55 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-08-23 19:51:55 +0400 |
| commit | b12b9fa91e3be0d4d157f144f4b20202cdb72917 (patch) | |
| tree | 23ee4c6c4bc8d6844823152769f562f380f33728 /library/PluginManager.cpp | |
| parent | c6c5ad56c9b4421e1bf8a5bc2f38323734a9d2eb (diff) | |
| download | dfhack-b12b9fa91e3be0d4d157f144f4b20202cdb72917.tar.gz dfhack-b12b9fa91e3be0d4d157f144f4b20202cdb72917.tar.bz2 dfhack-b12b9fa91e3be0d4d157f144f4b20202cdb72917.tar.xz | |
Suspend DF around loading and unloading plugins.
This is necessary to improve safety of vtable interposing.
Diffstat (limited to 'library/PluginManager.cpp')
| -rw-r--r-- | library/PluginManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp index 3c015b2a..d8b9ff27 100644 --- a/library/PluginManager.cpp +++ b/library/PluginManager.cpp @@ -195,6 +195,9 @@ bool Plugin::load(color_ostream &con) { return true; } + // enter suspend + CoreSuspender suspend; + // open the library, etc DFLibrary * plug = OpenPlugin(filename.c_str()); if(!plug) { @@ -270,6 +273,8 @@ bool Plugin::unload(color_ostream &con) } // wait for all calls to finish access->wait(); + // enter suspend + CoreSuspender suspend; // notify plugin about shutdown, if it has a shutdown function command_result cr = CR_OK; if(plugin_shutdown) |
