app: add gimp_data_factory_data_cancel()
Add a new GimpData::data_cancel() virtual function, and a corresponding gimp_data_factory_data_cancel() function. This function should cancel any ongoing async operations related to the factory (i.e., included in its async set), and wait for the operations to finish. Provide a default implementation that simply cancels and waits on the factory's async set. Use this function to cancel any ongoing operations during factory destruction, and in gimp_data_factory_data_free(). Override this function in GimpFontFactory, for which we can't really cancel font loading, and simply cancel and clear the factory's async set without waiting for loading to finish, making sure that nothing happens (and, in particular, that the factory isn't being accessed, since it might be already dead) when loading does finish.
Showing with 47 additions and 28 deletions