mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Let the plugin clean itself up
This commit is contained in:
parent
c9656399d1
commit
586f6327d3
1 changed files with 1 additions and 7 deletions
|
@ -349,14 +349,8 @@ bool PluginController::reload(const QString &id)
|
||||||
{
|
{
|
||||||
getApp()->getCommands()->unregisterPluginCommand(cmd);
|
getApp()->getCommands()->unregisterPluginCommand(cmd);
|
||||||
}
|
}
|
||||||
it->second->ownedCommands.clear();
|
|
||||||
|
|
||||||
if (it->second->state_ != nullptr)
|
|
||||||
{
|
|
||||||
lua_close(it->second->state_);
|
|
||||||
it->second->state_ = nullptr;
|
|
||||||
}
|
|
||||||
QDir loadDir = it->second->loadDirectory_;
|
QDir loadDir = it->second->loadDirectory_;
|
||||||
|
// Since Plugin owns the state, it will clean up everything related to it
|
||||||
this->plugins_.erase(id);
|
this->plugins_.erase(id);
|
||||||
this->tryLoadFromDir(loadDir);
|
this->tryLoadFromDir(loadDir);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue