[gnome-builder/wip/libide] libide: cache some nasty bugs



commit 67f0cb003081d031418e31615ead8111ddb822ed
Author: Christian Hergert <christian hergert me>
Date:   Tue Mar 3 23:52:02 2015 -0800

    libide: cache some nasty bugs

 libide/ide-source-view-mode.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-source-view-mode.c b/libide/ide-source-view-mode.c
index a49895e..c1f33c7 100644
--- a/libide/ide-source-view-mode.c
+++ b/libide/ide-source-view-mode.c
@@ -39,7 +39,8 @@ ide_source_view_mode_finalize (GObject *object)
   IdeSourceViewModePrivate *priv = ide_source_view_mode_get_instance_private (self);
 
   g_clear_object (&priv->view);
-  g_free (priv->name);
+  g_clear_pointer (&priv->name, g_free);
+  priv->type = 0;
 
   G_OBJECT_CLASS (ide_source_view_mode_parent_class)->finalize (object);
 }
@@ -197,7 +198,6 @@ _ide_source_view_mode_do_event (IdeSourceViewMode *mode,
   *remove = FALSE;
   switch (priv->type)
     {
-    default:
     case IDE_SOURCE_VIEW_MODE_TYPE_TRANSIENT:
       if (handled)
         {
@@ -220,6 +220,9 @@ _ide_source_view_mode_do_event (IdeSourceViewMode *mode,
     case IDE_SOURCE_VIEW_MODE_TYPE_MODAL:
       handled = TRUE;
       break;
+
+    default:
+      g_assert_not_reached ();
     }
 
   return handled;


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