Try to Cleanup Memory for Fix Memory Leaks ...
This commit is contained in:
@@ -42,7 +42,7 @@ class XCPOIDetector : public XCBaseAlert
|
||||
//
|
||||
public:
|
||||
//
|
||||
XCPOIDrawer mDrawer;
|
||||
XCPOIDrawer *mDrawer;
|
||||
|
||||
//
|
||||
// Constructors ...
|
||||
@@ -69,6 +69,10 @@ class XCPOIDetector : public XCBaseAlert
|
||||
mPeriod //
|
||||
);
|
||||
|
||||
//
|
||||
// Create Default Drawer Instance ...
|
||||
mDrawer = new XCPOIDrawer();
|
||||
|
||||
//
|
||||
// Apply Default Configurations ...
|
||||
Default();
|
||||
@@ -1048,6 +1052,10 @@ class XCPOIDetector : public XCBaseAlert
|
||||
DestroyPOIs();
|
||||
DestroySessions();
|
||||
DestroyEventListeners();
|
||||
|
||||
//
|
||||
delete mDrawer;
|
||||
delete mTicksZone;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1212,6 +1220,22 @@ class XCPOIDetector : public XCBaseAlert
|
||||
//
|
||||
Clean(mBullishFairValueGaps);
|
||||
Clean(mBearishFairValueGaps);
|
||||
|
||||
//
|
||||
ArrayFree(mSwingHighs);
|
||||
ArrayFree(mSwingLows);
|
||||
ArrayFree(mBullishMomentumBars);
|
||||
ArrayFree(mBearishMomentumBars);
|
||||
ArrayFree(mBullishRejectionBars);
|
||||
ArrayFree(mBearishRejectionBars);
|
||||
ArrayFree(mSupportZones);
|
||||
ArrayFree(mResistanceZones);
|
||||
ArrayFree(mSupplyZones);
|
||||
ArrayFree(mDemandZones);
|
||||
ArrayFree(mBullishOrderBlocks);
|
||||
ArrayFree(mBearishOrderBlocks);
|
||||
ArrayFree(mBullishFairValueGaps);
|
||||
ArrayFree(mBearishFairValueGaps);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1226,7 +1250,11 @@ class XCPOIDetector : public XCBaseAlert
|
||||
*/
|
||||
void DestroyEventListeners()
|
||||
{
|
||||
//
|
||||
Clean(mEventListeners);
|
||||
|
||||
//
|
||||
ArrayFree(mEventListeners);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1327,17 +1355,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
swing,
|
||||
mSwingHighs //
|
||||
);
|
||||
|
||||
//
|
||||
// XCSwingHighObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateSwingHigh(
|
||||
// swing,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1397,17 +1414,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
swing,
|
||||
mSwingLows //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCSwingLowObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateSwingLow(
|
||||
// swing,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1463,17 +1469,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
momentumBar,
|
||||
mBullishMomentumBars //
|
||||
);
|
||||
|
||||
//
|
||||
// XCBullishMomentumObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBullishMomentumBar(
|
||||
// momentumBar,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1529,17 +1524,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
momentumBar,
|
||||
mBearishMomentumBars //
|
||||
);
|
||||
|
||||
//
|
||||
// XCBearishMomentumObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBearishMomentumBar(
|
||||
// momentumBar,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1595,17 +1579,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
rejectionBar,
|
||||
mBullishRejectionBars //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCBullishRejectionObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBullishRejectionBar(
|
||||
// rejectionBar,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1661,17 +1634,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
rejectionBar,
|
||||
mBearishRejectionBars //
|
||||
);
|
||||
|
||||
//
|
||||
// XCBearishRejectionObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBearishRejectionBar(
|
||||
// rejectionBar,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1735,17 +1697,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
support,
|
||||
mSupportZones //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCSupportZoneObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateSupportZone(
|
||||
// support,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1805,17 +1756,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
resistance,
|
||||
mResistanceZones //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCResistanceZoneObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateResistanceZone(
|
||||
// resistance,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1902,17 +1842,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
supply,
|
||||
mSupplyZones //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCSupplyZoneObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateSupplyZone(
|
||||
// supply,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1999,17 +1928,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
demand,
|
||||
mDemandZones //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCDemandZoneObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateDemandZone(
|
||||
// demand,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2085,17 +2003,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
ob,
|
||||
mBullishOrderBlocks //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCBullishOrderBlockObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBullishOrderBlock(
|
||||
// ob,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2242,17 +2149,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
ob,
|
||||
mBearishOrderBlocks //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCBearishOrderBlockObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBearishOrderBlock(
|
||||
// ob,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2402,17 +2298,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
fvg,
|
||||
mBullishFairValueGaps //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCBullishFairValueGapObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBullishFairValueGap(
|
||||
// fvg,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2491,17 +2376,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
fvg,
|
||||
mBearishFairValueGaps //
|
||||
);
|
||||
|
||||
// //
|
||||
// XCBearishFairValueGapObject *iObj;
|
||||
// bool isCreated = mDrawer.CreateBearishFairValueGap(
|
||||
// fvg,
|
||||
// iObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// AddObjectIfNotExists(iObj);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4341,16 +4215,6 @@ class XCPOIDetector : public XCBaseAlert
|
||||
return result;
|
||||
}
|
||||
|
||||
// //
|
||||
// if (mTicksZoneObject != NULL)
|
||||
// {
|
||||
// mTicksZoneObject.Destroy();
|
||||
// }
|
||||
// mDrawer.CreateTicksZone(
|
||||
// mTicksZone,
|
||||
// mTicksZoneObject //
|
||||
// );
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user