ryanpoulos / LabVIEW-Memory

A library that provides a set of VIs and classes for performing explicit memory operations, such as pointer allocation and deallocation, in LabVIEW.
MIT License
3 stars 3 forks source link

LabVIEW crashes when I call Dispose twice. #7

Closed csjall closed 5 years ago

csjall commented 5 years ago

Currently there is nothing that prevents me from double disposing a memory block. We should add a pointer check to the (safe) API before disposing memory.

ryanpoulos commented 5 years ago

I added the check, but oddly enough if you call Dispose twice in succession, they both say the pointer is valid. I would think the second check would fail, but for some reason it doesn't. Either way, it no longer crashes LabVIEW and will still catch situations where a user tries to deallocate a pointer not allocated by LabVIEW.