DaveH
July 1, 2019, 9:21am
1
It feels like a silly question, so I do apologise if I’ve been getting far too much Sun lately, and it’s boiled my brains…
I just spotted this:-
MemoryBlock::~MemoryBlock() noexcept
{
}
Which doesn’t call ‘reset()’ at all, so why haven’t I been getting Memory Leak errors on shutdown?
Thanks.
Dave H.
daniel
July 1, 2019, 10:10am
2
It owns a HeapBlock as member, so when the member stack is unrolled, it triggers a free:
: std::malloc (static_cast<size_t> (numElements) * sizeof (ElementType))))
{
throwOnAllocationFailure();
}
/** Destructor.
This will free the data, if any has been allocated.
*/
~HeapBlock()
{
std::free (data);
}
/** Move constructor */
HeapBlock (HeapBlock&& other) noexcept
: data (other.data)
{
other.data = nullptr;
}
/** Move assignment operator */
1 Like
DaveH
July 1, 2019, 10:31am
3
Excellent, thanks for the detailed reply. That’s great news.
DaveH
July 1, 2019, 10:41am
4
Hmm, putting breakpoint on that free tells me it gets called all the time from ‘internalProcessReplacing’ in the VST wrapper although it always seems to be null,
Also in ‘getCurrentDisplayFromScaleFactor’ which is always valid data which I think is part of an Array display list.