diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 376bbc8f63..83fe5b1bd5 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -4,6 +4,7 @@ Recommended maintenance release. * Support building for macOS 11 "Big Sur" and "Apple Silicon" (arm64) * Fix a memory leak, particularly noticeable with multithreaded pipeline (#1077) +* Fix crash on macOS when unplugging device with threading active (#1082) * Fix error with build_apps not working with certain versions of Python * Fix DirectEntry/PGEntry flickering in the multithreaded pipeline (#1070) * Fix sounds resuming on reactivation if stop() was called while inactive (#559) diff --git a/panda/src/device/inputDeviceManager.cxx b/panda/src/device/inputDeviceManager.cxx index 8cd470e271..9f4f81c833 100644 --- a/panda/src/device/inputDeviceManager.cxx +++ b/panda/src/device/inputDeviceManager.cxx @@ -111,6 +111,8 @@ add_device(InputDevice *device) { */ void InputDeviceManager:: remove_device(InputDevice *device) { + // We need to hold a reference, since remove_device decrements the refcount. + PT(InputDevice) device_ref = device; { LightMutexHolder holder(_lock); _connected_devices.remove_device(device);