Bug 55811 - crash when unit's target is destroyed and removed
Summary: crash when unit's target is destroyed and removed
Status: RESOLVED FIXED
Alias: None
Product: boson
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: The Boson Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-10 21:35 UTC by Rivo Laks
Modified: 2003-03-19 23:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rivo Laks 2003-03-10 21:35:40 UTC
Version:            (using KDE 3.1.1)
Installed from:    compiled sources
Compiler:          gcc version 3.2.1
OS:          Linux (i686) release 2.4.18

When unit has a target (another unit) and this target gets destroyed and deleted, then if attacker's weapon's reloading time is > 200, target will be deleted before it's set to null in attacker and attacker will use wrong target pointer and crash.
Andi, you wanted to fix this by iterating over all units and checking their targets whenever some unit got deleted.

Rivo
Comment 1 Andreas Beckermann 2003-03-13 02:57:58 UTC
This should be fixed now (see my cvs log). 
I did not test it, so if you have a map / savegame with these conditions around it would be 
nice if you tested it. 
 
I am also not sure if we should call setWork(WorkNone) on the units that had the deleted 
unit as target - currently we just call setTarget(0). I'm not sure if that is enough - we'll see 
whether it causes ERROR or WARNING lines (that would be the worst thing that could 
happen, btw). 
 
CU 
Andi 
 
Comment 2 Rivo Laks 2003-03-19 23:14:44 UTC
It wasn't actually fixed - you had made a typo in bosoncanvas.cpp. But now I fixed it 
and it works. 
 
Rivo