0025973: Visualization, TKOpenGl - support EAGLContext as alternative to NSOpenGLContext
[occt.git] / src / Cocoa / Cocoa_LocalPool.hxx
index b5667c4..8c8d0d7 100644 (file)
 #ifndef __Cocoa_LocalPool_h_
 #define __Cocoa_LocalPool_h_
 
-//! Auxiliary class to create
+#if defined(__clang__) && (__clang_major__ >= 4) && __has_feature(objc_arc)
+
+// @autoreleasepool should be used within ARC
+
+#else
+
+#ifdef __OBJC__
+  @class NSAutoreleasePool;
+#else
+  struct NSAutoreleasePool;
+#endif
+
+//! Auxiliary class to create local pool.
 class Cocoa_LocalPool
 {
 
@@ -25,8 +37,10 @@ public:
 
 private:
 
-  void* myPoolObj;
+  NSAutoreleasePool* myPoolObj;
 
 };
 
+#endif // ARC
+
 #endif // __Cocoa_LocalPool_h_