From: Andreas F. <an...@fa...> - 2013-11-17 14:20:58
|
Hi, what's the recommended way to prevent objects from being garbage collected? For example, I create a wxImageList and pass it to wxNotebook::SetImageList(). As wxNotebook::SetImageList() doesn't take ownership of the list it could happen that the garbage collector kills the wxImageList that I passed to SetImageList(). To prevent it from being collected I could assign the wxImageList to a global variable but that doesn't look like a nice solution.... it would be nicer if it were possible to reference the wxImageList somehow but I don't see how this is possible. wxObject has a Ref() method but that doesn't seem to be up for the job. Any hints? -- Best regards, Andreas Falkenhahn mailto:an...@fa... |