2026-10-25 08:56:03 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| Releaser.mqh |
|
| | | //| Copyright 2026, Niquel Mendoza. |
|
| | | //| https://www.mql5.com |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "Copyright 2026, Niquel Mendoza."
|
| | | #property link "https://www.mql5.com"
|
| | | #property strict
|
| | |
|
| | | #ifndef TSNSTD_SRC_MEM_RELEASER_MQH
|
| | | #define TSNSTD_SRC_MEM_RELEASER_MQH
|
| | |
|
2026-10-25 09:14:35 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | namespace TSN
|
| | | {
|
2026-10-25 08:56:03 -05:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | class CGenericReleaser_ptr
|
| | | {
|
| | | public:
|
| | | CGenericReleaser_ptr(void) {}
|
| | | ~CGenericReleaser_ptr(void) {}
|
| | |
|
| | | //---
|
2026-10-25 09:14:35 -05:00 | | | template <typename TValue>
|
| | | static void Release(TValue* &ptr)
|
2026-10-25 08:56:03 -05:00 | | | {
|
2026-10-25 09:14:35 -05:00 | | | if(ptr != NULL)
|
2026-10-25 08:56:03 -05:00 | | | delete ptr;
|
| | | ptr = NULL;
|
| | | }
|
| | | //---
|
2026-10-25 09:14:35 -05:00 | | | static void* const s_free_value;
|
2026-10-25 08:56:03 -05:00 | | | };
|
| | |
|
| | | //+------------------------------------------------------------------+
|
2026-10-25 09:14:35 -05:00 | | | void* const CGenericReleaser_ptr::s_free_value = NULL;
|
2026-10-25 08:56:03 -05:00 | | |
|
2026-10-25 09:14:35 -05:00 | | | //---
|
| | | }
|
2026-10-25 08:56:03 -05:00 | | | #endif // TSNSTD_SRC_MEM_RELEASER_MQH
|
| | | //+------------------------------------------------------------------+
|