VirtualBox

Changeset 81134 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Oct 7, 2019 7:41:41 PM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/VBoxTray: Shutdown fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r81027 r81134  
    246246        {
    247247            LogFunc(("WM_CLIPBOARDUPDATE: pWinCtx=%p\n", pWinCtx));
     248
     249            if (pCtx->fShutdown) /* If we're about to shut down, skip handling stuff here. */
     250                break;
    248251
    249252            int rc = RTCritSectEnter(&pWinCtx->CritSect);
     
    828831    LogRel2(("Shared Clipboard: Destroying ...\n"));
    829832
    830     pCtx->fShutdown = true;
    831 
    832833    const PSHCLWINCTX pWinCtx = &pCtx->Win;
    833 
    834     if (pWinCtx->hWnd)
    835     {
    836         DestroyWindow(pWinCtx->hWnd);
    837         pWinCtx->hWnd = NULL;
    838     }
    839834
    840835    if (pCtx->hThread != NIL_RTTHREAD)
     
    845840                     rc, rcThread));
    846841        RT_NOREF(rc);
     842    }
     843
     844    if (pWinCtx->hWnd)
     845    {
     846        DestroyWindow(pWinCtx->hWnd);
     847        pWinCtx->hWnd = NULL;
    847848    }
    848849
     
    10191020                    }
    10201021
     1022                    case VBOX_SHCL_HOST_MSG_QUIT:
     1023                    {
     1024                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_QUIT;
     1025                        break;
     1026                    }
     1027
    10211028                    default:
    10221029                        rc = VERR_NOT_SUPPORTED;
     
    11451152    AssertPtr(pCtx);
    11461153
     1154    /* Set shutdown indicator. */
     1155    ASMAtomicWriteBool(&pCtx->fShutdown, true);
     1156
     1157    /* Let our clipboard know that we're going to shut down. */
     1158    PostMessage(pCtx->Win.hWnd, WM_QUIT, 0, 0);
     1159
     1160    /* Disconnect from the host service.
     1161    /* This will also send a VBOX_SHCL_HOST_MSG_QUIT from the host so that we can break out from our message worker. */
    11471162    VbglR3ClipboardDisconnect(pCtx->CmdCtx.uClientID);
    11481163    pCtx->CmdCtx.uClientID = 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette