Skip to content

Commit

Permalink
Restore commented-out code to set certain pointers to NULL on script …
Browse files Browse the repository at this point in the history
…environment deletion.

This fixes #73.
  • Loading branch information
avxsynth-testing committed Aug 10, 2012
1 parent e5580c7 commit 6412a7a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions avxsynth/core/src/core/avxsynth.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ VideoFrameBuffer::~VideoFrameBuffer() {
// _ASSERTE(refcount == 0); // _ASSERTE(refcount == 0);
InterlockedIncrement(&sequence_number); // HACK : Notify any children with a pointer, this buffer has changed!!! InterlockedIncrement(&sequence_number); // HACK : Notify any children with a pointer, this buffer has changed!!!
if (data) delete[] data; if (data) delete[] data;
//(BYTE*)data = 0; // and mark it invalid!! // Trick GCC into writing to a const variable. This behavior is undefined.
//(int)data_size = 0; // and don't forget to set the size to 0 as well! // The VFB class is in the public API so we are stuck with this hack.
BYTE** not_data = const_cast<BYTE**>(&data);
int* not_data_size = const_cast<int*>(&data_size);
*not_data = 0;
*not_data_size = 0;
} }
#endif #endif


Expand Down

0 comments on commit 6412a7a

Please sign in to comment.