Function probe block prevents destructor from running

I am creating a hardware source block and ran into an issue where the
destructor for the block does not appear to get called when closing the
flowgraph. This is problematic because I’m using the destructor to
hardware resources. I finally discovered that the problem only exists
using the “function probe” block to poll the block. Simply disabling the
function probe block in the flowgraph allows the destructor to run

I verified this behavior by creating a simple block with a single
statement in the constructor and destructor, as well as one in a probe
function. The destructor printf() does not get called when polling the
probe function.

Any idea why this happens or how to fix it?