mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 19:33:18 +00:00
bug 952928 - Ensure an autorelease pool is in place in InitializeVersionNumbers() before calling Cocoa APIs. r=benwa
This commit is contained in:
parent
fca94d9b16
commit
b1c89a165f
@ -12,6 +12,7 @@
|
||||
// This API will not work for OS X 10.10, see Gestalt.h.
|
||||
|
||||
#include "nsCocoaFeatures.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsObjCExceptions.h"
|
||||
|
||||
@ -51,6 +52,10 @@ nsCocoaFeatures::InitializeVersionNumbers()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
// Provide an autorelease pool to avoid leaking Cocoa objects,
|
||||
// as this gets called before the main autorelease pool is in place.
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
int major, minor, bugfix;
|
||||
GetSystemVersion(major, minor, bugfix);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user