diff options
-rw-r--r-- | scene.c | 9 | ||||
-rw-r--r-- | viewport.c | 2 |
2 files changed, 10 insertions, 1 deletions
@@ -117,6 +117,8 @@ newmodel(void) void delmodel(Model *m) { + if(m == nil) + return; if(m->obj != nil) objfree(m->obj); if(m->tex != nil) @@ -146,7 +148,10 @@ newentity(Model *m) void delentity(Entity *e) { - delmodel(e->mdl); + if(e == nil) + return; + if(e->mdl != nil) + delmodel(e->mdl); free(e); } @@ -176,6 +181,8 @@ newscene(char *name) void delscene(Scene *s) { + if(s == nil) + return; clearscene(s); free(s->name); free(s); @@ -52,6 +52,8 @@ mkviewport(Rectangle r) void rmviewport(Viewport *v) { + if(v == nil) + return; rmfbctl(v->fbctl); free(v); } |