Help with: Buffer_Not_Writeable_By_vImage
-
@Christoph-Hart should I try to cherry pick this JUCE commit? I'm not sure how different the message system is between 6 and 7....
-
@Dan-Korneff nice find! Yes, please try to cherry pick this, if it works, it would be awesome.
-
@Christoph-Hart I tried..
HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(295,22): error C2065: 'lock': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,26): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(300,26): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(393,22): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\..\JuceLibraryCode\i nclude_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C2146: syntax error: missing ';' before identifier 'scope' (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj] HISE\JUCE\modules\juce_events\messages\juce_MessageManager.cpp(409,22): error C2065: 'scope': undeclared identifier (compiling source file ..\..\JuceLibraryCode\include_juce_events.cpp) [Z:\Korneff Audio\Test Export\VST\Test Export\Binaries\Builds\VisualStudio2022\Test Export_SharedCode.vcxproj]
Looks a bit more involved.
-
@Dan-Korneff alright, I‘ll take a look.
-
@Christoph-Hart greatly appreciated !
-
@Dan-Korneff OK, I've manually patched the files (and I needed to pull in another class from JUCE 7 to compile), however now I'm hitting a few weird assertions that I didn't before so I'm a bit uncomfortable pushing this "fix" - it might be possible that there are other changes to JUCE 7's message handling and this would be a Frankenstein thing.
-
@Christoph-Hart Following the JUCE discussion, this might be a "better" fix (in the sense that it's less intrusive than the JUCE 7 fix):
https://forum.juce.com/t/blockingmessage-accessing-messagemanager-lock-that-went-out-of-scope/51901
-
@Christoph-Hart I can give this a try:
if (blockingMessage != nullptr) { { ScopedLock lock(blockingMessage->ownerCriticalSection); blockingMessage->owner.set(nullptr); } blockingMessage->releaseEvent.signal(); blockingMessage = nullptr; }
-
@Christoph-Hart Do you have any plans to eventually bump to JUCE 7?
-
@Christoph-Hart Does this look right? It's throwing a bunch of errors.
void MessageManager::Lock::exit() const noexcept { if (blockingMessage != nullptr) { { ScopedLock lock(blockingMessage->ownerCriticalSection); blockingMessage->owner.set(nullptr); } blockingMessage->releaseEvent.signal(); blockingMessage = nullptr; } const ScopeGuard scope{ [&] { blockingMessage = nullptr; } }; blockingMessage->stopWaiting(); if (!blockingMessage->wasAcquired()) return; if (auto* mm = MessageManager::instance) { jassert(mm->currentThreadHasLockedMessageManager()); mm->threadWithLock = {}; } }
EDIT: operator error. This works:
void MessageManager::Lock::exit() const noexcept { if (lockGained.compareAndSetBool (false, true)) { auto* mm = MessageManager::instance; jassert (mm == nullptr || mm->currentThreadHasLockedMessageManager()); lockGained.set (0); if (mm != nullptr) mm->threadWithLock = {}; if (blockingMessage != nullptr) { { ScopedLock lock(blockingMessage->ownerCriticalSection); blockingMessage->owner.set(nullptr); } blockingMessage->releaseEvent.signal(); blockingMessage = nullptr; } } }
Testing now