Persistent Application UIPasteboards are not removed on application removal

Originator:ashleycodes
Number:rdar://7023595 Date Originated:01-Jul-2009 08:59 AM
Status:Open Resolved:
Product:iPhone SDK Product Version:3.0
Classification:Other Bug Reproducible:Always
 
Summary:
An application UIPasteboard marked as persistent is persistent even across app deletes

Steps to Reproduce:
1. Compile test project
2. Run program
3. Tap on text view and enter text
4. Tap Done button
5. Close app
6. Remove app
6a. Optionally power-cycle device
7. Reinstall app
8. Run app and see that pasteboard contents are still preserved.

Expected Results:
I expected the pasteboard created by the application to be removed once the last application that had referenced it was removed from the device.

Actual Results:
The pasteboard seems to live forever once its created if removePasteboardWithName: is never called.

Regression:
n/a

Notes:
According to the documentation for the persistent property, "A persistent application pasteboard is removed when the owning application is uninstalled." This is clearly not happening.

Having pasteboards available to be shared between apps, especially persistent across reboots is a huge win and I'd hate to see this bug closed only to interfere with that behavior. So, here are my thoughts on this issue:

To remove a pasteboard once the creating app is gone is not entirely correct, especially with a shared pasteboard. Therefore, any apps using a pasteboard should have the pasteboard names declared in their Info.plist or be marked as co-owner on initial access. On the removal of the last of these apps, the pasteboard could be removed. The Info.plist method allows apps that have not run yet to still hold a claim on a pasteboard created within another app. While marking apps as co-owners on access allows the limited use of dynamically named pasteboards; they would still be removed if the second app had not accessed them but I see no easy way around that.

A possible solution to dynamically named pasteboards is have the ability to specify a lifetime for the pasteboard such that even if the owning app is deleted immediately after its' creation, the pasteboard could live for 10-30 minutes or some other value until it can be used by the second application.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!