Skip to content

Commit

Permalink
Fixed various potential crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Jan 22, 2025
1 parent 52ba566 commit 37f9767
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Libraries/pd-else
Submodule pd-else updated 61 files
+35 −0 Abstractions/Audio/gaterelease~.pd
+27 −0 Abstractions/Control/gatehold.pd
+39 −0 Abstractions/Control/gaterelease.pd
+77 −0 Abstractions/Merda/new modules/noise.m~-help copy.pd
+125 −0 Abstractions/Merda/new modules/noise.m~.pd
+22 −0 Abstractions/Merda/new modules/sfont.m~-help.pd
+226 −0 Abstractions/Merda/new modules/sfont.m~.pd
+7 −7 Documentation/Help-files/adsr~-help.pd
+82 −64 Documentation/Help-files/asr~-help.pd
+3 −3 Documentation/Help-files/bl.wavetable~-help.pd
+287 −292 Documentation/Help-files/envgen~-help.pd
+127 −92 Documentation/Help-files/format-help.pd
+72 −0 Documentation/Help-files/gatehold-help.pd
+42 −68 Documentation/Help-files/gatehold~-help.pd
+44 −0 Documentation/Help-files/gaterelease-help.pd
+44 −0 Documentation/Help-files/gaterelease~-help.pd
+115 −117 Documentation/Help-files/gaussian~-help.pd
+103 −103 Documentation/Help-files/parabolic~-help.pd
+168 −172 Documentation/Help-files/pulse~-help.pd
+175 −120 Documentation/Help-files/saw2~-help.pd
+177 −120 Documentation/Help-files/saw~-help.pd
+104 −105 Documentation/Help-files/sfont~-help.pd
+168 −167 Documentation/Help-files/square~-help.pd
+198 −223 Documentation/Help-files/tri~-help.pd
+165 −103 Documentation/Help-files/vsaw~-help.pd
+107 −73 Documentation/Help-files/wavetable~-help.pd
+119 −83 Documentation/Help-files/wt2d~-help.pd
+139 −92 Source/Audio/asr~.c
+3 −0 Source/Audio/beat~.c
+5 −2 Source/Audio/bl.imp2~.c
+5 −2 Source/Audio/bl.imp~.c
+5 −3 Source/Audio/bl.saw2~.c
+6 −5 Source/Audio/bl.saw~.c
+5 −3 Source/Audio/bl.square~.c
+5 −4 Source/Audio/bl.tri~.c
+5 −2 Source/Audio/bl.vsaw~.c
+5 −2 Source/Audio/cosine~.c
+223 −222 Source/Audio/envgen~.c
+207 −154 Source/Audio/gaussian~.c
+246 −207 Source/Audio/impulse2~.c
+5 −2 Source/Audio/impulse~.c
+189 −119 Source/Audio/parabolic~.c
+5 −2 Source/Audio/pimp~.c
+5 −2 Source/Audio/pluck~.c
+226 −202 Source/Audio/pulse~.c
+188 −127 Source/Audio/saw2~.c
+188 −117 Source/Audio/saw~.c
+2 −3 Source/Audio/sfont~/sfont~.c
+5 −2 Source/Audio/sine~.c
+225 −202 Source/Audio/square~.c
+187 −132 Source/Audio/tri~.c
+220 −177 Source/Audio/vsaw~.c
+227 −102 Source/Audio/wavetable~.c
+242 −105 Source/Audio/wt2d~.c
+1 −1 Source/Control/chance.c
+2 −2 Source/Control/popmenu.c
+246 −208 Source/Extra/Aliases/imp2~.c
+4 −1 Source/Extra/Aliases/imp~.c
+228 −102 Source/Extra/Aliases/wt~.c
+19 −1 Source/Shared/buffer.c
+2 −0 Source/Shared/buffer.h
5 changes: 1 addition & 4 deletions Source/Pd/MessageListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,7 @@ class MessageDispatcher : public AsyncUpdater {
atoms[at] = &atom;
}

//if (!symbol)
// continue;

for (auto it = target->second.begin(); it != target->second.end(); ++it) {
for (auto it = target->second.begin(); it < target->second.end(); ++it) {
if (auto* listener = it->get())
listener->receiveMessage(symbol, atoms);
else
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class PluginMode final : public Component
editor->setSize(newWidth - 1, newHeight - 1);
editor->setSize(newWidth, newHeight);
}
Timer::callAfterDelay(100, [this](){
editor->nvgSurface.invalidateAll();
Timer::callAfterDelay(100, [_editor = SafePointer(editor)](){
if(_editor) _editor->nvgSurface.invalidateAll();
});
}

Expand Down
7 changes: 5 additions & 2 deletions Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,11 @@ void PluginProcessor::receiveSysMessage(SmallString const& selector, SmallArray<

void PluginProcessor::addTextToTextEditor(uint64_t const ptr, SmallString const& text)
{
// TODO: this is not thread safe
Dialogs::appendTextToTextEditorDialog(textEditorDialogs[ptr].get(), text.toString());
MessageManager::callAsync([this, ptr, editorText = text.toString()](){
if(textEditorDialogs.contains(ptr)) {
Dialogs::appendTextToTextEditorDialog(textEditorDialogs[ptr].get(), editorText);
}
});
}

bool PluginProcessor::isTextEditorDialogShown(uint64_t const ptr)
Expand Down

0 comments on commit 37f9767

Please sign in to comment.