Create an NSAutoreleasePool in wxMacWakeUp().
An auto-release pool is needed in this function because it can be called from another thread which has no reason to have a pre-existing pool, but it does allocate NSEvent object which is auto-released, resulting in warnings if no pool available. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62310 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
dc72e2adfa
commit
3c7eea2563
@ -52,9 +52,27 @@ void wxBell()
|
||||
|
||||
void wxMacWakeUp()
|
||||
{
|
||||
NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint
|
||||
modifierFlags:NSAnyEventMask timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
|
||||
[NSApp postEvent:wakeupEvent atStart:NO];
|
||||
// ensure that we have an auto release pool in place because the event will
|
||||
// be autoreleased from NSEvent:otherEventWithType and we might not have a
|
||||
// global pool during startup or shutdown and we actually never have it if
|
||||
// we're called from another thread
|
||||
//
|
||||
// FIXME: we can't use wxMacAutoreleasePool here because it's in core and
|
||||
// we're in base
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined
|
||||
location:NSZeroPoint
|
||||
modifierFlags:NSAnyEventMask
|
||||
timestamp:0
|
||||
windowNumber:0
|
||||
context:nil
|
||||
subtype:0
|
||||
data1:0
|
||||
data2:0];
|
||||
[NSApp postEvent:wakeupEvent atStart:NO];
|
||||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
@ -323,4 +341,4 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#endif // wxOSX_USE_COCOA
|
||||
#endif // wxOSX_USE_COCOA
|
||||
|
Loading…
Reference in New Issue
Block a user