autorelease.h 811 B

12345678910111213141516171819202122232425262728293031
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/autorelease.h
  3. // Purpose: Automatic NSAutoreleasePool functionality
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/07/11
  7. // Copyright: (c) 2003 David Elliott <dfe@cox.net>
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_AUTORELEASE_H__
  11. #define __WX_COCOA_AUTORELEASE_H__
  12. #import <Foundation/NSAutoreleasePool.h>
  13. class wxAutoNSAutoreleasePool
  14. {
  15. public:
  16. wxAutoNSAutoreleasePool()
  17. {
  18. m_pool = [[NSAutoreleasePool alloc] init];
  19. }
  20. ~wxAutoNSAutoreleasePool()
  21. {
  22. [m_pool release];
  23. }
  24. protected:
  25. NSAutoreleasePool *m_pool;
  26. };
  27. #endif //__WX_COCOA_AUTORELEASE_H__