watch out for prototypes when making child surfaces
authorDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 16:37:14 +0000 (16:37 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 16:37:14 +0000 (16:37 +0000)
render2/surface.c

index 003dadd38fb9174ebfd414187c2a3d5436bbda19..23f2d107b05128d122700f2593cb457bcd5ded5b 100644 (file)
@@ -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? */