Browse Source

Fixed a crash when detaching WinRT MIDI devices

tags/2021-05-28
tpoole 8 years ago
parent
commit
9400866472
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      modules/juce_audio_devices/native/juce_win32_Midi.cpp

+ 4
- 2
modules/juce_audio_devices/native/juce_win32_Midi.cpp View File

@@ -619,15 +619,17 @@ private:
void run() override
{
auto parentPtr = &parent;
parent.watcher->add_Added (
Callback<ITypedEventHandler<DeviceWatcher*, DeviceInformation*>> (
[this](IDeviceWatcher*, IDeviceInformation* info) { return parent.addDevice (info); }
[parentPtr](IDeviceWatcher*, IDeviceInformation* info) { return parentPtr->addDevice (info); }
).Get(),
&parent.deviceAddedToken);
parent.watcher->add_Removed (
Callback<ITypedEventHandler<DeviceWatcher*, DeviceInformationUpdate*>> (
[this](IDeviceWatcher*, IDeviceInformationUpdate* info) { return parent.removeDevice (info); }
[parentPtr](IDeviceWatcher*, IDeviceInformationUpdate* info) { return parentPtr->removeDevice (info); }
).Get(),
&parent.deviceRemovedToken);


Loading…
Cancel
Save