mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +00:00
Fix bugs executing plugin init/exit() functions in different situations
Reinstalling a previously enabled plugin extension wasn't running the init() function, and uninstalling it wasn't calling its exit() function.
This commit is contained in:
parent
a39e235b23
commit
39ba883f90
@ -332,14 +332,12 @@ bool Extension::canBeUninstalled() const
|
|||||||
|
|
||||||
void Extension::enable(const bool state)
|
void Extension::enable(const bool state)
|
||||||
{
|
{
|
||||||
// Do nothing
|
if (m_isEnabled != state) {
|
||||||
if (m_isEnabled == state)
|
set_config_bool("extensions", m_name.c_str(), state);
|
||||||
return;
|
flush_config_file();
|
||||||
|
|
||||||
set_config_bool("extensions", m_name.c_str(), state);
|
m_isEnabled = state;
|
||||||
flush_config_file();
|
}
|
||||||
|
|
||||||
m_isEnabled = state;
|
|
||||||
|
|
||||||
#ifdef ENABLE_SCRIPTING
|
#ifdef ENABLE_SCRIPTING
|
||||||
if (hasScripts()) {
|
if (hasScripts()) {
|
||||||
@ -365,6 +363,9 @@ void Extension::uninstall(const DeletePluginPref delPref)
|
|||||||
TRACE("EXT: Uninstall extension '%s' from '%s'...\n",
|
TRACE("EXT: Uninstall extension '%s' from '%s'...\n",
|
||||||
m_name.c_str(), m_path.c_str());
|
m_name.c_str(), m_path.c_str());
|
||||||
|
|
||||||
|
// Execute exit actions of scripts
|
||||||
|
executeExitActions();
|
||||||
|
|
||||||
// Remove all files inside the extension path
|
// Remove all files inside the extension path
|
||||||
uninstallFiles(m_path, delPref);
|
uninstallFiles(m_path, delPref);
|
||||||
ASSERT(!base::is_directory(m_path) || delPref == DeletePluginPref::kNo);
|
ASSERT(!base::is_directory(m_path) || delPref == DeletePluginPref::kNo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user