Static member func clone?
Hi, i ran into a really weird problem:
Take the following code:
Code:
class CExample{
static CMemoryBuffer<CPlayerDescription>* Allocator()
{
static CMemoryBuffer<CPlayerDescription>* instance = new CMemoryBuffer<CPlayerDescription>();
return instance;
}
};
Now, i have another class within 2 member functions. Both functions do a call to CExample::Allocator to retrieve the allocator. However, weird enough they both got their own instances.
Is this normal behaviour? because the method is static, shouldn't it return the same instance?