[totem/gnome-3-26] save-file: Fix crash on exit in Flatpak



commit bf2175bbaf33e69fe67b2669e05c41ca71d9118c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 5 12:44:09 2019 +0100

    save-file: Fix crash on exit in Flatpak
    
    When the nautilus binary isn't available (like in a Flatpak),
    save-file's impl_activate() exits early. impl_deactivate() didn't check
    whether the activation exited early and tried to disconnect signals on
    NULL objects, caused a crash.

 src/plugins/save-file/totem-save-file.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/plugins/save-file/totem-save-file.c b/src/plugins/save-file/totem-save-file.c
index 2700e5c16..65c37fd44 100644
--- a/src/plugins/save-file/totem-save-file.c
+++ b/src/plugins/save-file/totem-save-file.c
@@ -379,6 +379,10 @@ impl_deactivate (PeasActivatable *plugin)
        TotemSaveFilePlugin *pi = TOTEM_SAVE_FILE_PLUGIN (plugin);
        TotemSaveFilePluginPrivate *priv = pi->priv;
 
+       /* impl_activate() exited early */
+       if (priv->totem == NULL)
+               return;
+
        g_signal_handlers_disconnect_by_func (priv->totem, totem_save_file_file_opened, plugin);
        g_signal_handlers_disconnect_by_func (priv->totem, totem_save_file_file_closed, plugin);
        g_signal_handlers_disconnect_by_func (priv->bvw, totem_save_file_download_filename, plugin);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]