We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5530074 commit 239dc40Copy full SHA for 239dc40
panda/src/device/ioKitInputDevice.cxx
@@ -22,8 +22,11 @@
22
#include "mouseButton.h"
23
24
static void removal_callback(void *ctx, IOReturn result, void *sender) {
25
- IOKitInputDevice *input_device = (IOKitInputDevice *)ctx;
+ // We need to hold a reference to this because it may otherwise be destroyed
26
+ // during the call to on_remove().
27
+ PT(IOKitInputDevice) input_device = (IOKitInputDevice *)ctx;
28
nassertv(input_device != nullptr);
29
+ nassertv(input_device->test_ref_count_integrity());
30
input_device->on_remove();
31
}
32
0 commit comments