Commit f2759fe1 authored by Stephan Arts's avatar Stephan Arts

Fix bug #7336, segfault when last image is closed or deleted

- Fix layout of license-header in main-image.c
parent e173092d
......@@ -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();
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment