28.08.2017 12:40, Slavomir Skopalik wrote:
there are two different situation: 1. cancel is call from different thread 2. cancel is called from call back
You don't need (and actually, cannot) cancel events from callback.
Why this: If you are create a object that wraps this interface, destruction of this object must be graceful. If call back happens when object is already destroyed, it causes random behavior and very hard to find.
That's why you must not create such objects. Callbacks were designed for procedural programming. Callback function in any case must be a plain global routine. If you sill insist on using objects, create subscribed objects list and remove the object from it on destruction. Don't rely on dirty hack with typecast of callback's parameter.
-- WBR, SD. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel