Fix bug 15276 by flushing the data to the clipboard right before app shuts down. (r=davidm).

This commit is contained in:
pinkerton%netscape.com 1999-11-04 00:08:59 +00:00
Родитель 6ab8568b72
Коммит f187d9fd82
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -47,6 +47,8 @@
#include "nsICookieService.h"
#include "nsIWindowMediator.h"
#include "nsIDOMWindow.h"
#include "nsIClipboard.h"
static NS_DEFINE_IID(kIWindowMediatorIID,NS_IWINDOWMEDIATOR_IID);
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
@ -682,6 +684,15 @@ int main(int argc, char* argv[])
}
#endif
// at this point, all that is on the clipboard is a proxy object, but that object
// won't be valid once the app goes away. As a result, we need to force the data
// out of that proxy and properly onto the clipboard. This can't be done in the
// clipboard service's shutdown routine because it requires the parser/etc which
// has already been shutdown by the time the clipboard is shut down.
NS_WITH_SERVICE(nsIClipboard, clipService, "component://netscape/widget/clipboard", &rv);
if ( clipService )
clipService->ForceDataToClipboard();
rv = NS_ShutdownXPCOM( NULL );
NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
return TranslateReturnValue( result );