diff --git a/src/bgfx.cpp b/src/bgfx.cpp index cea1d174c..a058cef98 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -13,8 +13,8 @@ #include "topology.h" #if BX_PLATFORM_OSX -#include -#endif +# include +#endif // BX_PLATFORM_OSX BX_ERROR_RESULT(BGFX_ERROR_TEXTURE_VALIDATION, BX_MAKEFOURCC('b', 'g', 0, 1) ); @@ -2186,30 +2186,32 @@ namespace bgfx } } } - + #if BX_PLATFORM_OSX struct NSAutoreleasePoolScope { NSAutoreleasePoolScope() { - id obj = class_createInstance(objc_getClass("NSAutoreleasePool"),0); - pool = objc_msgSend(obj, sel_getUid("init")); + id obj = class_createInstance(objc_getClass("NSAutoreleasePool"), 0); + pool = objc_msgSend(obj, sel_getUid("init") ); } + ~NSAutoreleasePoolScope() { - objc_msgSend(pool, sel_getUid("release")); + objc_msgSend(pool, sel_getUid("release") ); } + id pool; }; -#endif - +#endif // BX_PLATFORM_OSX + RenderFrame::Enum Context::renderFrame(int32_t _msecs) { BGFX_PROFILER_SCOPE("bgfx::renderFrame", 0xff2040ff); #if BX_PLATFORM_OSX NSAutoreleasePoolScope pool; -#endif +#endif // BX_PLATFORM_OSX if (!m_flipAfterRender) {