Search code examples
c++qtboehm-gc

Using QT with Boehm-Demers-Weiser-Gc


Is it possible to use Qt with BDW-GC? I know that Qt has a sophisticated System for memory management, but parts of my implementation will use a GC anyway, so it would be convenient to not bother and always use it.

As far as I read, one problem could be that Qt has specific destructors which must be called when an object is freed. So I would probably have to register finalizers manually, which call the destructors.

Anyway, I haven't found much info on using Qt with BDW-GC. This is why I am asking.


Solution

  • This will not be fun. C++ programs and Qt is no exception use destructors not only for freeing memory, but also for other jobs, see for example into QMutexLocker. You will have to do a lot of porting.