From b907fd45db5f53b5fb37f0c7c720b7e395cbe612 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 26 May 2003 16:37:14 +0000 Subject: [PATCH] watch out for prototypes when making child surfaces --- render2/surface.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/render2/surface.c b/render2/surface.c index 003dadd3..23f2d107 100644 --- a/render2/surface.c +++ b/render2/surface.c @@ -53,6 +53,10 @@ struct RrSurface *RrSurfaceNewChild(enum RrSurfaceType type, { struct RrSurface *sur; + /* cant be a child of a prototype! */ + assert(parent->inst); + if (!parent->inst) return NULL; + sur = surface_new(type, numtex); sur->inst = parent->inst; sur->win = None; /* XXX XCreateWindow? */ @@ -102,6 +106,10 @@ struct RrSurface *RrSurfaceCopyChild(struct RrSurface *orig, { struct RrSurface *sur; + /* cant be a child of a prototype! */ + assert(parent->inst); + if (!parent->inst) return NULL; + sur = surface_copy(orig); sur->inst = parent->inst; sur->win = None; /* XXX XCreateWindow? */ -- 2.34.1