Tracktion / tracktion_engine

Tracktion Engine module
Other
1.16k stars 148 forks source link

Make more classes inherit from juce::ReferenceCountedObject #112

Closed adamnemecek closed 2 years ago

adamnemecek commented 2 years ago

Is there a good argument for why e.g. te::MidiEvent or te::MidiEventHolder should not inherit from juce::ReferenceCountedObject?

In my code I keep a reference to some of these pointers. Before I made te::MidiEvent inherit from juce::ReferenceCountedObject, I would get a lot of dangling pointer warnings after the program terminated. Once I made it inherit from juce::ReferenceCountedObject, the warnings went away. I'm not sure if this is the right way of solving this though.

drowaudio commented 2 years ago

I think this was discussed at length on discord and the conclusion was this isn't a good way to hold on to MIDI notes.