mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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/trunk@482 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -7,10 +7,15 @@
|
||||
#define CEF_LIBCEF_CEF_THREAD_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "base/threading/thread.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
class MessageLoopProxy;
|
||||
}
|
||||
@@ -180,6 +185,10 @@ class CefThread : public base::Thread {
|
||||
struct DeleteOnIOThread : public DeleteOnThread<IO> { };
|
||||
struct DeleteOnFileThread : public DeleteOnThread<FILE> { };
|
||||
|
||||
protected:
|
||||
virtual void Init();
|
||||
virtual void Cleanup();
|
||||
|
||||
private:
|
||||
// Common initialization code for the constructors.
|
||||
void Initialize();
|
||||
@@ -211,6 +220,10 @@ class CefThread : public base::Thread {
|
||||
// on the UI thread by the g_browser_process object. CefThreads remove
|
||||
// themselves from this array upon destruction.
|
||||
static CefThread* cef_threads_[ID_COUNT];
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define REQUIRE_UIT() DCHECK(CefThread::CurrentlyOn(CefThread::UI))
|
||||
|
Reference in New Issue
Block a user