Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 03-22-2019, 01:18 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default ReaScript: MIDIEditor_GetMode fails on macOS (FIXED)

On WindowsOS and Linux, MIDIEditor_GetMode is useful for testing whether a MIDI editor window still exists. If it doesn't, the function returns -1.

On macOS, the function fails if the editor has been closed, and raises an error.
juliansader is offline   Reply With Quote
Old 03-28-2019, 07:54 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,117
Default

Fixing (though the behavior in this scenario on Windows is also hit or a miss)
Justin is offline   Reply With Quote
Old 03-29-2019, 06:23 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I think it is important to have functions such as MIDIEditor_GetMode and ValidatePtr2 with type "Window*" that can *reliably and quickly* check whether a window still exists, since, on macOS and Linux, WDL/swell functions as well as native API functions such as DockIsChildOfDock may crash REAPER dramatically if the HWND argument refers to a window that doesn't exist any more.
juliansader is offline   Reply With Quote
Old 03-29-2019, 08:19 AM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 16,117
Default

MIDIEditor_GetMode() handling this gracefully is straightforward. DockIsChildOfDock() however is a bit tricky, ugh. Hmmmm
Justin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.