From fd799ca57ecce0db70ddc05953f0f1e9a81d51d4 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 25 Jun 2010 14:18:22 -0700 Subject: Fix for EXT-8089 (Log spam from SLPlugin about "autoreleased with no pool in place - just leaking") Added slplugin-objc.mm. Made SLPlugin do the cocoa setup during initialization, and create/delete an autorelease pool each time through its main loop. This should make plugin code that's using autorelease correctly not leak. Fixed a bug in the version of setupCocoa() used in the viewer (it was never setting its "inited" variable). --- indra/llplugin/slplugin/slplugin.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/llplugin/slplugin/slplugin.cpp') diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 7d6dde1a58..4c955e875a 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -44,6 +44,7 @@ #if LL_DARWIN #include + #include "slplugin-objc.h" #endif #if LL_DARWIN || LL_LINUX @@ -229,10 +230,19 @@ int main(int argc, char **argv) signal(SIGSYS, &crash_handler); // non-existent system call invoked #endif +#if LL_DARWIN + setupCocoa(); + createAutoReleasePool(); +#endif + LLPluginProcessChild *plugin = new LLPluginProcessChild(); plugin->init(port); +#if LL_DARWIN + deleteAutoReleasePool(); +#endif + LLTimer timer; timer.start(); @@ -260,6 +270,9 @@ int main(int argc, char **argv) #endif while(!plugin->isDone()) { +#if LL_DARWIN + createAutoReleasePool(); +#endif timer.reset(); plugin->idle(); #if LL_DARWIN @@ -377,6 +390,10 @@ int main(int argc, char **argv) // exception handler such as QuickTime. //checkExceptionHandler(); #endif + +#if LL_DARWIN + deleteAutoReleasePool(); +#endif } delete plugin; -- cgit v1.2.3