matthewh806 / killing_me_softly_with_his_dsp

A collection of small audio experiments, applications & prototypes
0 stars 0 forks source link

Pulsar: Code check #67

Closed matthewh806 closed 1 year ago

matthewh806 commented 1 year ago

Check the necessity of these nullptr checks in code/applications/pulsar/PluginProcessor.cpp in the PulsarAudioProcessor::handleAsyncUpdate(). It shouldn't be necessary with the recent refactorings so perhaps its code which I forgot to delete.

However... it could also be the case that logic that follows (ball creation etc) could trigger a method or a listener expecting the editor to pick it up, which if it isn't visible on the screen is nullptr (I think!) so just check it doesn't break stuff before deleting and fix the code if it does cause a crash.

   ...

   auto* editor = getActiveEditor();
    if(editor == nullptr)
    {
        return;
    }

    auto* pulsarEditor = static_cast<PulsarAudioProcessorEditor*>(editor);
    if(pulsarEditor == nullptr)
    {
        return;
    }

   ...