[Xfce4-commits] <ristretto:ristretto-0.0> Fix bug #7336, segfault when last image is closed or deleted - Fix layout of license-header in main-image.c

Stephan Arts noreply at xfce.org
Sun Oct 23 19:30:51 CEST 2011


Updating branch refs/heads/ristretto-0.0
         to f2759fe16b3d70ff597376879138ef17fdba8c00 (commit)
       from e173092dd2337eb0d816af608c201a7c9c14c3e4 (commit)

commit f2759fe16b3d70ff597376879138ef17fdba8c00
Author: Stephan Arts <stephan at xfce.org>
Date:   Mon Feb 28 20:47:26 2011 +0100

    Fix bug #7336, segfault when last image is closed or deleted
    - Fix layout of license-header in main-image.c

 src/image_list.c  |   10 ++++++++++
 src/main_window.c |    4 +++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/image_list.c b/src/image_list.c
index 9346d98..7f7af18 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -262,6 +262,14 @@ rstto_image_list_remove_image (RsttoImageList *image_list, RsttoImage *image)
             if (rstto_image_list_iter_get_image (iter->data) == image)
             {
                 rstto_image_list_iter_previous (iter->data);
+                /* If the image is still the same, 
+                 * it's a single item list,
+                 * and we should force the image in this iter to NULL
+                 */
+                if (rstto_image_list_iter_get_image (iter->data) == image)
+                {
+                    ((RsttoImageListIter *)(iter->data))->priv->image = NULL;
+                }
             }
             iter = g_slist_next (iter);
         }
@@ -503,7 +511,9 @@ rstto_image_list_iter_previous (RsttoImageListIter *iter)
 
     position = g_list_previous (position);
     if (position)
+    {
         iter->priv->image = position->data; 
+    }
     else
     {
         settings = rstto_settings_new();
diff --git a/src/main_window.c b/src/main_window.c
index 8aa40ac..8e13103 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -12,7 +12,9 @@
  *  GNU Library General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */ 
+ *  along with this program; if not, write to the Free Software 
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+ */ 
 
 #include <config.h>
 #include <gtk/gtk.h>


More information about the Xfce4-commits mailing list