Re: Drag pasteboard owner asked for data upon quitting
Re: Drag pasteboard owner asked for data upon quitting
- Subject: Re: Drag pasteboard owner asked for data upon quitting
- From: Wim Lewis <email@hidden>
- Date: Tue, 13 Jul 2010 15:08:49 -0700
On Jul 13, 2010, at 2:35 PM, Philip White wrote:
> I can understand why other pasteboards would ask for data upon quitting, but why would the drag pasteboard?
I think it's just general pasteboard behavior: it has to be able to fulfill the promised datatypes if someone eventually asks for them. The problem, in my opinion, is that the drag pasteboard is keeping its state long after the data is still useful --- I'm sure we've filed RADARs on the subject in the past but at this point it's just one of those things we know we need to work around.
We do two things, depending on the data: if it's small data or held in an immutable object, we simply retain it until we are no longer the pasteboard's owner, regardless of which pasteboard it is. This means we may eventually get asked for the data at app termination time, but that's OK, we can still provide it. (This is obviously the right behavior for the general pasteboard; we just use the same code for the drag pasteboard.)
If that isn't practical, we explicitly clear out the pasteboard at some point, e.g. when -dragImage:at:... returns to its caller.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden