[totem] save-file: Fix possible assertion



commit 24c309fec02d0dd46f45b0780c8c08d4d5745b8e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 23 01:54:12 2011 +0000

    save-file: Fix possible assertion
    
    Turns out that we're not certain of receiving a "file-closed" for
    every file that's replaced.
    
    Launch Totem on a local file, with an already running instance,
    with a local file already opened.

 src/plugins/save-file/totem-save-file.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/save-file/totem-save-file.c b/src/plugins/save-file/totem-save-file.c
index 638d8c1..2c5b68f 100644
--- a/src/plugins/save-file/totem-save-file.c
+++ b/src/plugins/save-file/totem-save-file.c
@@ -213,7 +213,12 @@ totem_save_file_file_opened (TotemObject *totem,
 	TotemSaveFilePluginPrivate *priv = pi->priv;
 	GtkAction *action;
 
-	g_assert (pi->priv->mrl == NULL);
+	if (pi->priv->mrl != NULL) {
+		g_free (pi->priv->mrl);
+		pi->priv->mrl = NULL;
+		g_free (pi->priv->name);
+		pi->priv->name = NULL;
+	}
 
 	if (mrl == NULL)
 		return;



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