I'm creating a custom class for automaticly cleaning up memory. The class contains a pointer to an SDL_Surface object and calls it's refcount when needed. The problem is when I implement the custom copy assigment operator the system crashes with the following code:
"Unhandled exception at 0x771a15de in xyz.exe: 0xC0000005: Access violation reading location 0xcccccd04."
and the object attribute "address" suddenly gets the value "0x0000ffff ", whilst using the default copy assignment operator it runs perfectly fine.