Bug 531580 - ""gtk_clipboard_get_for_display: assertion `!display->closed' failed" after closing browser" [r=karlt]

This commit is contained in:
Martin Stránský 2009-12-02 15:01:50 -06:00
Родитель 1910252b12
Коммит 3793052726
1 изменённых файлов: 10 добавлений и 2 удалений

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

@ -121,18 +121,26 @@ clipboard_text_received(GtkClipboard *clipboard,
gpointer data);
nsClipboard::nsClipboard()
{
{
}
nsClipboard::~nsClipboard()
{
// We have to clear clipboard before gdk_display_close() call.
// See bug 531580 for details.
if (mGlobalTransferable) {
gtk_clipboard_clear(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
}
if (mSelectionTransferable) {
gtk_clipboard_clear(gtk_clipboard_get(GDK_SELECTION_PRIMARY));
}
}
NS_IMPL_ISUPPORTS1(nsClipboard, nsIClipboard)
nsresult
nsClipboard::Init(void)
{
{
nsresult rv;
nsCOMPtr<nsIObserverService> os
(do_GetService("@mozilla.org/observer-service;1", &rv));