зеркало из https://github.com/mozilla/gecko-dev.git
Bug 541809 - Firefox autoreleasing objects without pool in place. r=josh,jfkthame
This commit is contained in:
Родитель
7522fa3186
Коммит
c3cac2c620
|
@ -56,6 +56,20 @@
|
|||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
class nsAutoreleasePool {
|
||||
public:
|
||||
nsAutoreleasePool()
|
||||
{
|
||||
mLocalPool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
~nsAutoreleasePool()
|
||||
{
|
||||
[mLocalPool release];
|
||||
}
|
||||
private:
|
||||
NSAutoreleasePool *mLocalPool;
|
||||
};
|
||||
|
||||
// font info loader constants
|
||||
static const PRUint32 kDelayBeforeLoadingCmaps = 8 * 1000; // 8secs
|
||||
static const PRUint32 kIntervalBetweenLoadingCmaps = 150; // 150ms
|
||||
|
@ -274,6 +288,8 @@ MacOSFontEntry::ReadCMAP()
|
|||
nsresult
|
||||
MacOSFontEntry::GetFontTable(PRUint32 aTableTag, nsTArray<PRUint8>& aBuffer)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
ATSFontRef fontRef = GetFontRef();
|
||||
if (fontRef == (ATSFontRef)kATSUInvalidFontID)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -321,6 +337,8 @@ public:
|
|||
void
|
||||
gfxMacFontFamily::LocalizedName(nsAString& aLocalizedName)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
if (!HasOtherFamilyNames()) {
|
||||
aLocalizedName = mName;
|
||||
return;
|
||||
|
@ -346,6 +364,8 @@ gfxMacFontFamily::FindStyleVariations()
|
|||
if (mHasStyles)
|
||||
return;
|
||||
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
NSString *family = GetNSStringForString(mName);
|
||||
|
||||
// create a font entry for each face
|
||||
|
@ -502,6 +522,8 @@ public:
|
|||
void
|
||||
gfxSingleFaceMacFontFamily::LocalizedName(nsAString& aLocalizedName)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
if (!HasOtherFamilyNames()) {
|
||||
aLocalizedName = mName;
|
||||
return;
|
||||
|
@ -567,6 +589,8 @@ gfxMacPlatformFontList::gfxMacPlatformFontList() :
|
|||
void
|
||||
gfxMacPlatformFontList::InitFontList()
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
ATSGeneration currentGeneration = ::ATSGetGeneration();
|
||||
|
||||
// need to ignore notifications after adding each font
|
||||
|
@ -730,6 +754,8 @@ gfxMacPlatformFontList::ATSNotification(ATSFontNotificationInfoRef aInfo,
|
|||
gfxFontEntry*
|
||||
gfxMacPlatformFontList::GetDefaultFont(const gfxFontStyle* aStyle, PRBool& aNeedsBold)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
NSString *defaultFamily = [[NSFont userFontOfSize:aStyle->size] familyName];
|
||||
nsAutoString familyName;
|
||||
|
||||
|
@ -751,6 +777,8 @@ gfxFontEntry*
|
|||
gfxMacPlatformFontList::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
|
||||
const nsAString& aFontName)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
|
||||
NSString *faceName = GetNSStringForString(aFontName);
|
||||
|
||||
// first lookup a single face based on postscript name
|
||||
|
|
|
@ -257,6 +257,8 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
|||
return nsnull;
|
||||
NS_ADDREF(mimeInfoMac);
|
||||
|
||||
NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
OSStatus err;
|
||||
PRBool haveAppForType = PR_FALSE;
|
||||
PRBool haveAppForExt = PR_FALSE;
|
||||
|
@ -349,6 +351,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
|||
nsCOMPtr<nsILocalFileMac> app(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
|
||||
if (!app) {
|
||||
NS_RELEASE(mimeInfoMac);
|
||||
[localPool release];
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -413,6 +416,7 @@ nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
|||
|
||||
PR_LOG(mLog, PR_LOG_DEBUG, ("OS gave us: type '%s' found '%i'\n", mimeType.get(), *aFound));
|
||||
|
||||
[localPool release];
|
||||
return mimeInfoMac;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче