Support Board
Date/Time: Fri, 09 May 2025 16:10:29 +0000
Allocating Dynamic Memory for Classes
View Count: 976
[2016-07-11 14:09:51] |
skelcap - Posts: 139 |
Looking here: https://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#DynamicMemoryAllocations I understand you can't use new/delete with Visual C++ in Debug mode because the CRT debug heap crashes on delete when it can't find the allocated block (because the heap list gets cleared when the DLL unloads). So for arrays and unstructured memory blocks you offer the AllocateMemory/FreeMemory functions. However for classes with constructors/destructors you still suggest new/delete, which doesn't work in debug mode for the above reason. What do you suggest? Obviously it does work in release mode but then you can't debug. Is there a way to disable the CRT debug heap in Debug mode? I guess I could just use AllocateMemory/FreeMemory and write my own construction/destruction routines to be called explicitly without calling new/delete, but wondering if there's a better way ... |
[2016-07-11 16:47:43] |
|
You need to make sure to set sc.FreeDLL = 0. This should solve the problem.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2016-07-11 17:03:53] |
skelcap - Posts: 139 |
I see how that would work thanks, but then I have to reopen Sierra Chart every time I want to recompile correct?
|
[2016-07-11 17:18:11] |
|
Yes.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: