]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a crash in dpm + framegroups
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 21 Jun 2009 20:14:31 +0000 (20:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 21 Jun 2009 20:14:31 +0000 (20:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9030 d7cf8633-e32d-0410-b094-e92efae38249

model_shared.c

index 73326a22bb2444540479964528d4afcb3c80278b..60a59cfaf267bb296fdd78c47557a20fb746a020 100644 (file)
@@ -280,9 +280,8 @@ void Mod_FrameGroupify(dp_model_t *mod, const char *buf)
        mod->numframes = cnt;
 
        // 1. reallocate
-       if(mod->animscenes)
-               Mem_Free(mod->animscenes);
-       mod->animscenes = (animscene_t *) Mem_Alloc(tempmempool, sizeof(animscene_t) * mod->numframes);
+       // (we do not free the previous animscenes, but model unloading will free the pool owning them, so it's okay)
+       mod->animscenes = (animscene_t *) Mem_Alloc(mod->mempool, sizeof(animscene_t) * mod->numframes);
 
        // 2. parse
        Mod_FrameGroupify_ParseGroups(buf, Mod_FrameGroupify_ParseGroups_Store, mod);