aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_clip.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-08-07 09:43:22 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-08-07 09:43:22 +0000
commit61c2345c5535a2ea3ebd7cb69dcccb13db61d6e4 (patch)
treea7d1f4fb531352985fe4e730c77f576be1c9c028 /legacy/evas/src/lib/canvas/evas_clip.c
parentedje: fix memory leak when alias are present. (diff)
downloadefl-61c2345c5535a2ea3ebd7cb69dcccb13db61d6e4.tar.gz
evas: properly warn when linking object from different canvas.
SVN revision: 74968
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_clip.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_clip.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c
index 6baa28cdb3..1597bfced1 100644
--- a/legacy/evas/src/lib/canvas/evas_clip.c
+++ b/legacy/evas/src/lib/canvas/evas_clip.c
@@ -176,14 +176,44 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
return;
MAGIC_CHECK_END();
if (obj->cur.clipper == clip) return;
- if (obj == clip) return;
+ if (obj == clip)
+ {
+ CRIT("Setting clip %p on itself", obj)
+ return;
+ }
+ if (clip->delete_me)
+ {
+ CRIT("Setting deleted object %p as clip obj %p", clip, obj);
+ abort();
+ return;
+ }
+ if (obj->delete_me)
+ {
+ CRIT("Setting object %p as clip to deleted obj %p", clip, obj);
+ abort();
+ return;
+ }
+ if (!obj->layer)
+ {
+ CRIT("No evas surface associated with object (%p)", obj);
+ abort();
+ return;
+ }
+ if ((obj->layer && clip->layer) &&
+ (obj->layer->evas != clip->layer->evas))
+ {
+ CRIT("Setting object %p from Evas (%p) to another Evas (%p)", obj, obj->layer->evas, clip->layer->evas);
+ abort();
+ return;
+ }
+
if (evas_object_intercept_call_clip_set(obj, clip)) return;
// illegal to set anything but a rect as a clip
- /* if (clip->type != o_rect_type) */
- /* { */
- /* ERR("For now a clip on other object than a rectangle is disabled"); */
- /* return; */
- /* } */
+ if (clip->type != o_rect_type)
+ {
+ ERR("For now a clip on other object than a rectangle is disabled");
+ return;
+ }
if (obj->smart.smart)
{
if (obj->smart.smart->smart_class->clip_set)