Nux

Comment 35 for bug 758248

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I have tested my suggestion - removing the "if (!OwnsTheReference() )" blocks from Object::Reference and Object::UnReference.

The good news:
* Unity is stable with the change.
* The corruption described in bug 769957 and seemingly due to window/nux leaks is half fixed (but not fully)

The bad news:
* compiz average memory usage seems to be LARGER, not smaller.

So it seems on average, fixing the reference count to be larger when it should be larger actually means that broken client code (unity) which is missing the required number of Dispose/UnReference calls now leaks in places it didn't before. This makes sense if you imagine that floating references assigned to container objects are more common than non-contained floating references.

So sadly not a change I can recommend right now.

A more defensive and more compatible fix involves fixing the floating references (mostly in unity?) one-by-one :(

I strongly suggest separating each type of leak into a separate bug, where the code changes and valgrind results are small and individually verifiable. The Load2DTextureFile leak is one such example. That can be a bug in itself.

It's probably not realistic to continue trying to fix everything in this one bug and then say "the leaks in compiz are now all fixed".