add dedicated stopAll()
should not change abi
This commit is contained in:
@ -108,6 +108,8 @@ Plugin::Plugin(Plugin&& other) {
|
||||
|
||||
_fn_render = other._fn_render;
|
||||
other._fn_render = nullptr;
|
||||
|
||||
_running = other._running;
|
||||
}
|
||||
|
||||
// unloads the plugin
|
||||
@ -122,14 +124,22 @@ Plugin::~Plugin(void) {
|
||||
}
|
||||
|
||||
// runs the start function
|
||||
uint32_t Plugin::start(SolanaAPI* solana_api) const {
|
||||
uint32_t Plugin::start(SolanaAPI* solana_api) {
|
||||
assert(valid_plugin);
|
||||
if (_running) {
|
||||
return 1;
|
||||
}
|
||||
_running = true;
|
||||
return reinterpret_cast<decltype(&solana_plugin_start)>(_fn_start)(solana_api);
|
||||
}
|
||||
|
||||
// stop function
|
||||
void Plugin::stop(void) const {
|
||||
void Plugin::stop(void) {
|
||||
assert(valid_plugin);
|
||||
if (!_running) {
|
||||
return;
|
||||
}
|
||||
_running = false;
|
||||
reinterpret_cast<decltype(&solana_plugin_stop)>(_fn_stop)();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user