Commit d558d49c authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Handle a borderline case correctly

svn path=/trunk/; revision=17608
parent b235fff0
2007-04-18 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkregion-generic.h (GROWREGION): Handle the case
of nRects == 0 correctly.
2007-04-18 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c (gtk_recent_manager_lookup_item): Fix
......
......@@ -83,14 +83,20 @@ struct _GdkRegion
(idRect)->extents.y2 = (r)->y2;\
}
#define GROWREGION(reg, nRects){ \
if ((reg)->rects == &(reg)->extents) { \
(reg)->rects = g_new (GdkRegionBox, (nRects)); \
(reg)->rects[0] = reg->extents; \
} \
else \
(reg)->rects = g_renew (GdkRegionBox, (reg)->rects, (nRects)); \
(reg)->size = (nRects); \
#define GROWREGION(reg, nRects) { \
if ((nRects) == 0) { \
if ((reg)->rects != &(reg)->extents) { \
g_free ((reg)->rects); \
(reg)->rects = &(reg)->extents; \
} \
} \
else if ((reg)->rects == &(reg)->extents) { \
(reg)->rects = g_new (GdkRegionBox, (nRects)); \
(reg)->rects[0] = (reg)->extents; \
} \
else \
(reg)->rects = g_renew (GdkRegionBox, (reg)->rects, (nRects)); \
(reg)->size = (nRects); \
}
/*
......
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