Merge revision 482 changes:

- Mac: Fix the "no autorelease pool in place" error by initializing an NSAutoreleasePool on every thread (issue #502).

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/963@629 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-05-17 20:04:23 +00:00
parent 266f4e7a27
commit a63833acfd
6 changed files with 47 additions and 29 deletions

View File

@ -6,10 +6,6 @@
#include "cef_process_sub_thread.h"
#include "build/build_config.h"
#if defined(OS_WIN)
#include <Objbase.h>
#endif
CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier)
: CefThread(identifier) {}
@ -23,22 +19,11 @@ CefProcessSubThread::~CefProcessSubThread() {
Stop();
}
void CefProcessSubThread::Init() {
#if defined(OS_WIN)
// Initializes the COM library on the current thread.
CoInitialize(NULL);
#endif
}
void CefProcessSubThread::CleanUp() {
// Flush any remaining messages. This ensures that any accumulated
// Task objects get destroyed before we exit, which avoids noise in
// purify leak-test results.
MessageLoop::current()->RunAllPending();
#if defined(OS_WIN)
// Closes the COM library on the current thread. CoInitialize must
// be balanced by a corresponding call to CoUninitialize.
CoUninitialize();
#endif
CefThread::Cleanup();
}