From: divverent Date: Tue, 15 May 2007 23:12:54 +0000 (+0000) Subject: calling VM_SetTraceGlobals can create a tempstring for the texture name; thus, X-Git-Tag: xonotic-v0.1.0preview~3167 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3bddef8837924e402d275a0201ae25ecf3767b09;p=xonotic%2Fdarkplaces.git calling VM_SetTraceGlobals can create a tempstring for the texture name; thus, make sure that the tempstring gets freed when VM_SetTraceGlobals gets called from outside QC (before calling the touch function) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7286 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/sv_phys.c b/sv_phys.c index 8de8f7ea..357327d3 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -610,14 +610,17 @@ Two entities have touched, so run their touch functions ================== */ extern void VM_SetTraceGlobals(const trace_t *trace); +extern sizebuf_t vm_tempstringsbuf; void SV_Impact (prvm_edict_t *e1, trace_t *trace) { + int restorevm_tempstringsbuf_cursize; int old_self, old_other; prvm_edict_t *e2 = (prvm_edict_t *)trace->ent; prvm_eval_t *val; old_self = prog->globals.server->self; old_other = prog->globals.server->other; + restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; VM_SetTraceGlobals(trace); @@ -650,6 +653,7 @@ void SV_Impact (prvm_edict_t *e1, trace_t *trace) prog->globals.server->self = old_self; prog->globals.server->other = old_other; + vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; }