Here is some more background regarding the problem.
JUCE (actually Tracktion Engine) is used in an iOS framework and the framework is used in a Cordova plugin. The reason we use Cordova is to be able to call JUCE/Tracktion Engine functionality in an iOS app built in Javascript.
Here is the stripped Objective-C++ method causing the problem.
- (void)insertSongClipMidi:(CDVInvokedUrlCommand*)command
{
// Here usually goes code for getting data from the Javascript side.
// I get the problem both with and without this code.
juce::MidiFile midiFile;
// Here usually goes code for returning data to the Javascript side.
// I get the problem both with and without this code.
}
I have a number of other Objective-C++ methods inserting wav clips, playing tracks etc where I get no dangling pointers.
The only time we experience dangling pointers is when using the juce::MidiFile.
very strange. Looking at the construcor for MidiFile it simply initializes a member variable called timeFormat. As well, this class has existed for quite a long time, so one would expect a report of this issue previously. My gut says the declaration of the class, unto itself, is not the issue.