| 05-10-2007, 03:51 AM | #1 | |
I was trying to make some system using struct, but an error has showed up, Code:
Double free of type : somelibrary__somestruct what does this mean ? hmm btw this is my code of the system
|
| 05-10-2007, 04:15 AM | #2 |
It means you are calling .destroy() on the same object twice. |
| 05-10-2007, 05:14 AM | #3 |
Since when does JASS allow structs to be made? |
| 05-10-2007, 05:16 AM | #4 |
Since vJASS... |
| 05-10-2007, 05:39 AM | #5 |
What's vJASS? Lol. |
| 05-10-2007, 07:54 AM | #6 |
go to warcraft editing tools and download jass new gen pack. This will give u so much power over noobish jass |
| 05-10-2007, 11:23 AM | #7 |
mmmm weird, i've look into my code few times and i still cant see the part where i called .destroy() twice on the same struct @.@ |
| 05-10-2007, 01:28 PM | #8 |
Well don't expect to find a line with JASS:
s.destroy()
s.destroy()
That won't happen unless you are really weird at coding, if you would actually tell us the name of the library and struct type it would be easier to tractk, but either way if it is double free of type xlibrary_foo then something you could do is add different debug messages before every place you call destroy on an object of that type and see the one called before that warning appears. The error itself is not a big deal, it just protected you from a double free, when you compile it in non-debug mode the warning will not appear. But it is a sign of a coding mistake, that could probably cause other issues, the same part that is double freeing that thing could be doing other wrong stuff. |
| 05-10-2007, 02:47 PM | #9 |
ahhh ! thanks !! I've finally found my mistake, I forget to change the sd.id to the new id when i moved the last struct to the destryoing struct !! all was fixed when i replaced the DestroySpiralEffect with this JASS:function DestroySpiralEffect takes SpiralData sd returns nothing if sd.id != TotalSpiral then set SD[sd.id] = SD[TotalSpiral] // set SD[TotalSpiral].id = sd.id //moving last data to this data debug call BJDebugMsg("moving spiral of "+I2S(TotalSpiral)+" to "+I2S(sd.id)) endif debug call BJDebugMsg("have a total spiral of "+I2S(TotalSpiral)) set TotalSpiral = TotalSpiral - 1 loop if sd.has_e then call DestroyEffect(sd.e[sd.n]) endif call RecycleCaster(sd.u[sd.n]) set sd.n = sd.n - 1 exitwhen sd.n < 1 endloop call sd.destroy() endfunction many mnay thanks !! +rep ![]() |
