HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What does this mean?

04-29-2008, 08:48 PM#1
dhobby
When testing my map with the "newGen" editor I get a red line saying "double free of group Trig_ExpSystem_Actions". This only occurs when I use the test map button and after I kill a creep and does not occur when playing in single player mode.
The code it MAY be referring to is from this link http://www.hiveworkshop.com/resources_new/spells/1131/
Trigger:
InitializeExpSystem
Collapse Events
Map initialization
Conditions
Collapse Actions
-------- this is the time at which the experience floating texts gets removed (seconds) --------
Set zz_ExperienceFloatingTextTime = 2.00
-------- this is the experience tag added to the floating text --------
-------- ex: +60.00(experience tag) --------
Set zzStr_ExperienceTag = EXP
-------- This is the maximum range at which heroes can take some of the exp taken. --------
Set zz_MaxRangeOfExp = 1000.00
-------- This is the experience a unit rewards when it dies --------
-------- it is based on level so if the creeps level is 2 then (zz_ExperiencePerLevel x 2(Level Of Creep) --------
-------- is the amount of experience given --------
Set zz_ExperiencePerLevel = 10.00
-------- bonus experience is only achieved when experience is divided so system will be more balanced --------
-------- This is the experience the killer gets when a unit dies if there are ally heroes near him --------
-------- so basically the killer gets a 30% extra experience bonus since he actually killed the unit --------
-------- 100% experience is the average bounty but since the experience gets divided --------
-------- and the killer actually killed the creep he should get a 30% experience bonus --------
-------- so if there is one hero then the experience will be divided by 2 which makes each get 50% --------
-------- which is not fair for the killer so he gets a 30% experience bonus. --------
Set zz_ExtraXPForKiller = (zz_ExperiencePerLevel x 0.30)
-------- The other heroes get a 10% bonus just to balance the system. (same concept) --------
Set zz_ExtraXPForOther = (zz_ExperiencePerLevel x 0.10)
-------- Disables Blizzards XP System --------
Custom script: call SetPlayerHandicapXP(Player(0), 0.00)
Custom script: call SetPlayerHandicapXP(Player(1), 0.00)
Custom script: call SetPlayerHandicapXP(Player(2), 0.00)
Custom script: call SetPlayerHandicapXP(Player(3), 0.00)
Custom script: call SetPlayerHandicapXP(Player(4), 0.00)
Custom script: call SetPlayerHandicapXP(Player(5), 0.00)
Custom script: call SetPlayerHandicapXP(Player(6), 0.00)
Custom script: call SetPlayerHandicapXP(Player(8), 0.00)
Custom script: call SetPlayerHandicapXP(Player(9), 0.00)
Custom script: call SetPlayerHandicapXP(Player(10), 0.00)
Custom script: call SetPlayerHandicapXP(Player(11), 0.00)
Custom script: call SetPlayerHandicapXP(Player(12), 0.00)
Custom script: call SetPlayerHandicapXP(Player(13), 0.00)
Custom script: call SetPlayerHandicapXP(Player(14), 0.00)
Custom script: call SetPlayerHandicapXP(Player(15), 0.00)
Trigger:
ExpSystem
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Killing unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
Collapse Actions
Set zz_bIsThereHero = False
Set zz_HeroKillerLoc = (Position of (Killing unit))
Set zz_HeroAllies = (Units within zz_MaxRangeOfExp of zz_HeroKillerLoc matching (((((Matching unit) is A Hero) Equal to True) and ((Matching unit) Not equal to (Killing unit))) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Set zz_HeroAlliesAmount = ((Number of units in zz_HeroAllies) + 1)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
zz_HeroAlliesAmount Greater than 1
Collapse Then - Actions
Set zz_OtherExperience = ((zz_ExperiencePerLevel x (Real((Level of (Triggering unit))))) / (Real(zz_HeroAlliesAmount)))
Set zz_FinalOtherExperience = (zz_OtherExperience + (zz_ExtraXPForOther x (Real((Level of (Triggering unit))))))
Set zz_Experience = ((zz_ExperiencePerLevel x (Real((Level of (Triggering unit))))) / (Real(zz_HeroAlliesAmount)))
Set zz_FinalExperience = (zz_Experience + (zz_ExtraXPForKiller x (Real((Level of (Triggering unit))))))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to False
Collapse Then - Actions
Collapse Unit Group - Pick every unit in zz_HeroAllies and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to (Owner of (Killing unit))
Collapse Then - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_FinalExperience))))) + zzStr_ExperienceTag) above (Picked unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_FinalExperience)) experience to (Picked unit), Show level-up graphics
Collapse Else - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_FinalOtherExperience))))) + zzStr_ExperienceTag) above (Picked unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_FinalOtherExperience)) experience to (Picked unit), Show level-up graphics
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_FinalExperience))))) + zzStr_ExperienceTag) above (Killing unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Show (Last created floating text) for (Player group((Owner of (Killing unit))))
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_FinalExperience)) experience to (Killing unit), Show level-up graphics
Collapse Unit Group - Pick every unit in zz_HeroAllies and do (Actions)
Collapse Loop - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_FinalOtherExperience))))) + zzStr_ExperienceTag) above (Picked unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_FinalOtherExperience)) experience to (Picked unit), Show level-up graphics
Else - Actions
Custom script: call DestroyGroup(udg_zz_HeroAllies)
Custom script: set udg_zz_HeroAllies = null
Custom script: call RemoveLocation(udg_zz_HeroKillerLoc)
Collapse Else - Actions
Set zz_Experience = (zz_ExperiencePerLevel x (Real((Level of (Triggering unit)))))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to False
Collapse Then - Actions
Set zz_Hero = (Units within zz_MaxRangeOfExp of zz_HeroKillerLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to (Owner of (Killing unit))))))
Collapse Unit Group - Pick every unit in zz_Hero and do (Actions)
Collapse Loop - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_Experience))))) + zzStr_ExperienceTag) above (Picked unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_Experience)) experience to (Picked unit), Show level-up graphics
Set zz_bIsThereHero = True
Custom script: call DestroyGroup(udg_zz_Hero)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
zz_bIsThereHero Equal to True
Then - Actions
Collapse Else - Actions
Set zz_Hero = (Units within zz_MaxRangeOfExp of zz_HeroKillerLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Killing unit))) Equal to True))))
Collapse Unit Group - Pick every unit in zz_Hero and do (Actions)
Collapse Loop - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_Experience))))) + zzStr_ExperienceTag) above (Picked unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_Experience)) experience to (Picked unit), Show level-up graphics
Collapse Else - Actions
Floating Text - Create floating text that reads ((+ + (String((Integer(zz_Experience))))) + zzStr_ExperienceTag) above (Killing unit) with Z offset 0.00, using font size 10.00, color (50.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Hide (Last created floating text) for (All players)
Floating Text - Show (Last created floating text) for (Player group((Owner of (Killing unit))))
Floating Text - Set the velocity of (Last created floating text) to 90.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to zz_ExperienceFloatingTextTime seconds
Hero - Add (Integer(zz_Experience)) experience to (Killing unit), Show level-up graphics
Custom script: call DestroyGroup(udg_zz_HeroAllies)
Custom script: call DestroyGroup(udg_zz_Hero)
Custom script: set udg_zz_HeroAllies = null
Custom script: call RemoveLocation(udg_zz_HeroKillerLoc)

The code has been repasted above in hopes that this problem can be diagnosed more quickly. If someone could tell me if "double free of group Trig_ExpSystem_Actions" is a leak or something or a way to fix it, I'd appreciate it. Thanks for your time.
04-29-2008, 11:20 PM#2
Vexorian
It means a group is getting destroyed twice
04-30-2008, 02:10 AM#3
dhobby
thank you for the response but does it cause lag and do I need to worry about it? thanks again
04-30-2008, 02:47 AM#4
Vexorian
Well, war3err warns about it because it is often a sign something in the code is not correct. So it is more of a symptom than a problem, it is always good to check it out to verify what's causing it. No healthy code should ever call DestroyGroup on the same object twice.
04-30-2008, 04:32 AM#5
PurgeandFire111
Destroy the trigger once in the end. You use DestroyGroup two times so it is executed two times if that is the case. ;)

So leave all the creations and destructions to their respective if blocks and there won't be a problem.
05-01-2008, 03:00 AM#6
dhobby
thank you guys