Hi,

I'm using Wt's drag and drop system in this fashion:

When I drag a widget to a destination widget, the destination
widget responds to the drop by using the source widget's pointer
(passed from drop event) to get useful data such as a key to a
database record. Then, the destination widget deletes the source.

Here's the problem:

When dragging a source widget to a destination widget twice at
almost the same time (while Wt is 'loading'), a crash happens
(program tries to access a source widget that's already deleted).

I did a (quick) grep and it seems as if the source widget's
implementation does not
delete its entry in WApplication::encodedObjects_ before being destroyed by the
destination widget. As a result, WApplication::decodeObject()
is giving me an invalid pointer to a source widget instead of a null one.

If I could put a function like: app_->eraseEncodedObject(this)
in the destructor of my source widgets, my destination widget
will be able to ignore drop events that carry null pointers to source widgets.

Will Wt provide a function like the above so that encodedObjects_ can
be managed by the user?

I appreciate your time.

Regards,
David

------------------------------------------------------------------------------
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to