mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 558489 - prevent cocoa object autorelease-leakage during ipc startup. r=josh
This commit is contained in:
parent
3e4381af31
commit
5e4a15e897
@ -7,6 +7,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/scoped_nsautorelease_pool.h"
|
||||
|
||||
// A simple class that demonstrates our impressive ability to do nothing.
|
||||
@interface NoOp : NSObject
|
||||
@ -34,6 +35,10 @@ namespace base {
|
||||
//
|
||||
// http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/chapter_4_section_4.html
|
||||
void InitThreading() {
|
||||
// this is called early in startup, before the event loop, so provide
|
||||
// an autorelease pool to prevent leaks here
|
||||
ScopedNSAutoreleasePool pool;
|
||||
|
||||
static BOOL multithreaded = [NSThread isMultiThreaded];
|
||||
if (!multithreaded) {
|
||||
[NSThread detachNewThreadSelector:@selector(noOp)
|
||||
|
Loading…
Reference in New Issue
Block a user