The answer to your question is .... *probably*
In the last week I forked hbQt and added tons of hb_trace, following the runtime of a small sample program almost line by line.
As you know qt qobjects have their own life and in hbQt we decided to keep this behavior: you may have a living qt object without a living harbour variable, like in cpp. But it brings a lot of situations that may be not easily addressable and need helpers classes both in harbour and in cpp. Some of these cases are also present if we decided that there should a living harbour variable for each qt object.
The problem I found and solved in my branch were related to the codeblocks used with signals and events: they were not, in my opinion, correctly released, and gc, due to variables present in those codeblocks, could not fully release.
But despite these specific and other changes I still get a crash opening a QDialog for the nth time, with n>1.
Using the debugger, the crash happens in qt code, in qdialog:exec() where a qscopedpointer fails, in a call stack of screen painting, asking the objects for accessible (for blind people f.e.) features.
Two ways to not have the crash:
- keep the qt object live but hidden
- create an hbqt object aka do something... on the vm stack, on hbqt internals?
I created a qwidget, as per the infamous
:setparent(qwidget())
and now I wonder if the setparent or the qwidget() creation solved, well, masked the problem.
Probably, somewhere inside hbQt, there is code that mishandle a PHB_ITEM expecially for objects... f.e. in which cases should I do a hb_arrayId?
Francesco