mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-27 02:20:05 +00:00
Changed the Message class to be reference-counted, and used this to tighten up some messaging code. Minor tweaks to AudioThumbnail, ReferenceCountedArray.
This commit is contained in:
parent
1a887cda63
commit
d60f661789
22 changed files with 573 additions and 527 deletions
|
|
@ -65,7 +65,9 @@ static LRESULT CALLBACK juce_MessageWndProc (HWND h,
|
|||
// here in case there are windows modal dialog boxes doing their own
|
||||
// dispatch loop and not calling our version
|
||||
|
||||
MessageManager::getInstance()->deliverMessage ((Message*) lParam);
|
||||
Message* const message = reinterpret_cast <Message*> (lParam);
|
||||
MessageManager::getInstance()->deliverMessage (message);
|
||||
message->decReferenceCount();
|
||||
return 0;
|
||||
}
|
||||
else if (message == broadcastId)
|
||||
|
|
@ -153,7 +155,9 @@ bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages
|
|||
{
|
||||
if (m.message == specialId && m.hwnd == juce_messageWindowHandle)
|
||||
{
|
||||
MessageManager::getInstance()->deliverMessage ((Message*) (void*) m.lParam);
|
||||
Message* const message = reinterpret_cast <Message*> (m.lParam);
|
||||
MessageManager::getInstance()->deliverMessage (message);
|
||||
message->decReferenceCount();
|
||||
}
|
||||
else if (m.message == WM_QUIT)
|
||||
{
|
||||
|
|
@ -184,6 +188,7 @@ bool juce_dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages
|
|||
//==============================================================================
|
||||
bool juce_postMessageToSystemQueue (Message* message)
|
||||
{
|
||||
message->incReferenceCount();
|
||||
return PostMessage (juce_messageWindowHandle, specialId, 0, (LPARAM) message) != 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue