Skip to content

xfconf-cache: Fix access to freed data (#16)

cryptogopher requested to merge (removed):issue16 into master

The code was based on false assumption that cancelling cancellable of asynchronous request stops execution of callback handler. In fact cancelling asynchronous call does not prevent callback from geting invoked. Moreover handlers for asynchronous call are only invoked from thread's main loop. That means if you set property, then free cache you will have outstanding handler invocations with dangling pointers to XfconfCacheOldItem and no reliable way of detecting this situation inside handler. The solution is to only free old_item(s) inside handler and differentiate processing inside handler based on whether call has been cancelled (by checking cancellable status).

Edited by cryptogopher

Merge request reports

Loading