mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Fix crash disabling extensions
This commit is contained in:
parent
1f34d0e46e
commit
ff3e9504fd
@ -226,6 +226,9 @@ Extension::Extension(const std::string& path,
|
||||
, m_isInstalled(true)
|
||||
, m_isBuiltinExtension(isBuiltinExtension)
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
m_plugin.pluginRef = LUA_REFNIL;
|
||||
#endif
|
||||
}
|
||||
|
||||
Extension::~Extension()
|
||||
@ -326,11 +329,13 @@ void Extension::enable(const bool state)
|
||||
m_isEnabled = state;
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (m_isEnabled) {
|
||||
initScripts();
|
||||
}
|
||||
else {
|
||||
exitScripts();
|
||||
if (hasScripts()) {
|
||||
if (m_isEnabled) {
|
||||
initScripts();
|
||||
}
|
||||
else {
|
||||
exitScripts();
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_SCRIPTING
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user