creating the variable in the function 'caller' passing it as a parameter, and the same function caller 'frees' the variable immediately after the function call.
:-)
That was one way I considered too, but that requires me to add a lot more logic in order to work for a specific event (namely the paint event). So yes, you were right ;-)
And... at the moment I have too much other code to sort out before I need to worry too much about this - I can always come back to it and apply that kind of logic if it's going to be better for everyone.