Although you did not paste the complete listing, it seems like the sync object is not a member field of your VideoSource class, but rather a local variable (in constructor I guess). If this is the case then sync is destructed as soon as the constructor is executed, which removes the callback.