From: <lpa...@us...> - 2013-08-09 08:42:29
|
Revision: 8749 http://sourceforge.net/p/planeshift/code/8749 Author: lpancallo Date: 2013-08-09 08:42:26 +0000 (Fri, 09 Aug 2013) Log Message: ----------- valgrind memory leaks fixes by Ralph Campbell. #6048 #6086 Modified Paths: -------------- trunk/src/client/clientvitals.cpp trunk/src/client/clientvitals.h trunk/src/common/rpgrules/vitals.h trunk/src/server/bulkobjects/servervitals.h Modified: trunk/src/client/clientvitals.cpp =================================================================== --- trunk/src/client/clientvitals.cpp 2013-08-05 13:18:47 UTC (rev 8748) +++ trunk/src/client/clientvitals.cpp 2013-08-09 08:42:26 UTC (rev 8749) @@ -40,6 +40,11 @@ { counter = 0; counterSet = false; + + for(int i = 0; i < VITAL_COUNT; i++) //ticket 6048 + { + vitals[i].drRate = 0; + } } void psClientVitals::HandleDRData(psStatDRMessage& msg, const char *labelname ) Modified: trunk/src/client/clientvitals.h =================================================================== --- trunk/src/client/clientvitals.h 2013-08-05 13:18:47 UTC (rev 8748) +++ trunk/src/client/clientvitals.h 2013-08-09 08:42:26 UTC (rev 8749) @@ -37,6 +37,8 @@ /// A character vital (such as HP or Mana) - client side struct Vital { + Vital() : value(0.0), drRate(0.0) {} + float value; float drRate; }; Modified: trunk/src/common/rpgrules/vitals.h =================================================================== --- trunk/src/common/rpgrules/vitals.h 2013-08-05 13:18:47 UTC (rev 8748) +++ trunk/src/common/rpgrules/vitals.h 2013-08-09 08:42:26 UTC (rev 8749) @@ -75,11 +75,6 @@ experiencePoints = 0; progressionPoints = 0; lastDRUpdate = 0; - for(int i = 0; i < VITAL_COUNT; i++) - { - vitals[i].value = 0; - origVitals[i].value = 0; - } } ~psVitalManager() {} Modified: trunk/src/server/bulkobjects/servervitals.h =================================================================== --- trunk/src/server/bulkobjects/servervitals.h 2013-08-05 13:18:47 UTC (rev 8748) +++ trunk/src/server/bulkobjects/servervitals.h 2013-08-09 08:42:26 UTC (rev 8749) @@ -64,6 +64,8 @@ /// A character vital (such as HP or Mana) - server side. struct Vital { + Vital() : value(0.0) {} + float value; VitalBuffable drRate; ///< Amount added to this vital each second VitalBuffable max; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |