[Development] RFC: RAII for property changes

Christian Kandeler christian.kandeler at theqtcompany.com
Wed Apr 15 17:25:42 CEST 2015


On 04/15/2015 05:12 PM, Matthew Woehlke wrote:
> [Valid points about the inconsistent state of the object elided.]
>
> On 2015-04-15 10:58, André Somers wrote:
>> What if that slot [connected to the instance property changed
>> signal] triggers something that ends up deleting the instance?
>
> Then the slot is broken. What if the sender needs to do something after
> it delivers the signal? What if other slots are connected? Deleting a
> signal sender from a slot connected to the signal is inherently
> dangerous. Don't do it.

While delete is probably the most extreme case, all other operations on 
the sender have the same conceptual problem. I'd even argue that the 
delete case is relatively benign, because it very likely fails loudly, 
rather than in some subtle way.


Christian




More information about the Development mailing list