From: frohlich Date: Sun, 28 Jan 2007 20:03:43 +0000 (+0000) Subject: Modified Files: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b028adb6af41c63b1086d5f42760a2119447e163;p=simgear.git Modified Files: simgear/structure/SGAtomic.cxx: Plug memory leak originating from wrong atomic fallback operations. --- diff --git a/simgear/structure/SGAtomic.cxx b/simgear/structure/SGAtomic.cxx index 3505fabf..9eabf4ec 100644 --- a/simgear/structure/SGAtomic.cxx +++ b/simgear/structure/SGAtomic.cxx @@ -39,7 +39,7 @@ unsigned __sync_sub_and_fetch_4(volatile void *ptr, unsigned value) : "=r" (result), "=m" (*mem) : "0" (-value), "m" (*mem) : "memory"); - return result; + return result - value; } unsigned __sync_add_and_fetch_4(volatile void *ptr, unsigned value) @@ -50,7 +50,7 @@ unsigned __sync_add_and_fetch_4(volatile void *ptr, unsigned value) : "=r" (result), "=m" (*mem) : "0" (value), "m" (*mem) : "memory"); - return result; + return result + value; } void __sync_synchronize()