diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-19 14:26:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-19 14:26:43 +0400 |
commit | c3041ae7cda20c78040e7deea17530fe5f41029d (patch) | |
tree | 3190e3af2ab7f81833f379771f5fdcd8819bd635 /intern/string | |
parent | e611c4756fa17c57855123dc2b5c2c2408b0d790 (diff) |
- fix for BGE warnings
- when C++ uses guardedalloc SYS_DeleteSystem was called after MEM_printmemlist(), making it look like there was a leak.
Diffstat (limited to 'intern/string')
-rw-r--r-- | intern/string/STR_String.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index 941430fd976..a5e7a0721ec 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -50,6 +50,9 @@ using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif class STR_String; @@ -191,6 +194,13 @@ protected: char *pData; // -> STR_String data int Len; // Data length int Max; // Space in data buffer + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); } |