mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 969498 - [Qt] ICU usage conflict, ABORT: JS_SetICUMemoryFunctions failed. r=n.nethercote,nfroyd
This commit is contained in:
parent
3b9891aa7e
commit
28401717e6
@ -11,6 +11,7 @@
|
||||
#include <MApplicationService>
|
||||
#endif
|
||||
#include "prenv.h"
|
||||
#include "nsXPCOMPrivate.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
QApplication *nsQAppInstance::sQAppInstance = nullptr;
|
||||
@ -29,6 +30,7 @@ void nsQAppInstance::AddRef(int& aArgc, char** aArgv, bool aDefaultProcess) {
|
||||
QApplication::setGraphicsSystem(QString(graphicsSystem));
|
||||
}
|
||||
#endif
|
||||
mozilla::SetICUMemoryFunctions();
|
||||
sQAppInstance = new QApplication(aArgc, aArgv);
|
||||
}
|
||||
sQAppRefCount++;
|
||||
|
@ -194,6 +194,8 @@ namespace mozilla {
|
||||
nsresult
|
||||
ShutdownXPCOM(nsIServiceManager* servMgr);
|
||||
|
||||
void SetICUMemoryFunctions();
|
||||
|
||||
/**
|
||||
* C++ namespaced version of NS_LogTerm.
|
||||
*/
|
||||
|
@ -554,10 +554,7 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
||||
// can't define the alloc/free functions in the JS engine, because it can't
|
||||
// depend on the XPCOM-based memory reporting goop. So for now, we have
|
||||
// this oddness.
|
||||
if (!JS_SetICUMemoryFunctions(ICUReporter::Alloc, ICUReporter::Realloc,
|
||||
ICUReporter::Free)) {
|
||||
NS_RUNTIMEABORT("JS_SetICUMemoryFunctions failed.");
|
||||
}
|
||||
mozilla::SetICUMemoryFunctions();
|
||||
|
||||
// Initialize the JS engine.
|
||||
if (!JS_Init()) {
|
||||
@ -658,6 +655,19 @@ NS_ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
void
|
||||
SetICUMemoryFunctions()
|
||||
{
|
||||
static bool sICUReporterInitialized = false;
|
||||
if (!sICUReporterInitialized) {
|
||||
if (!JS_SetICUMemoryFunctions(ICUReporter::Alloc, ICUReporter::Realloc,
|
||||
ICUReporter::Free)) {
|
||||
NS_RUNTIMEABORT("JS_SetICUMemoryFunctions failed.");
|
||||
}
|
||||
sICUReporterInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user