VirtualBox

Changeset 46075 in vbox


Ignore:
Timestamp:
May 14, 2013 4:52:57 PM (12 years ago)
Author:
vboxsync
Message:

Main/DisplayImpl: 6711: Code fix for SMP and code improvement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r46065 r46075  
    149149    }
    150150   
    151     if (RTCritSectIsInitialized (&mSaveSeamlessRectLock))
    152     {
    153         RTCritSectDelete (&mSaveSeamlessRectLock);
    154         memset (&mSaveSeamlessRectLock, 0, sizeof (mSaveSeamlessRectLock));
     151    if (RTCritSectIsInitialized(&mSaveSeamlessRectLock))
     152    {
     153        RTCritSectDelete(&mSaveSeamlessRectLock);
     154        memset(&mSaveSeamlessRectLock, 0, sizeof (mSaveSeamlessRectLock));
    155155    }
    156156    BaseFinalRelease();
     
    483483        maFramebuffers[ul].fDefaultFormat = false;
    484484
     485        maFramebuffers[ul].mcSavedVisibleRegion = 0;
     486        maFramebuffers[ul].mpSavedVisibleRegion = NULL;
     487
    485488        memset (&maFramebuffers[ul].dirtyRect, 0 , sizeof (maFramebuffers[ul].dirtyRect));
    486489        memset (&maFramebuffers[ul].pendingResize, 0 , sizeof (maFramebuffers[ul].pendingResize));
     
    835838         * applied after the resize of the framebuffer is completed
    836839         */
    837         if (pFBInfo->mcSavedVisibleRegion)
    838         {
    839             handleSetVisibleRegion(pFBInfo->mcSavedVisibleRegion,
    840                                    pFBInfo->mpSavedVisibleRegion);
    841 
     840        SaveSeamlessRectLock();
     841        PRTRECT pSavedSeamlessRgn = pFBInfo->mpSavedVisibleRegion;
     842        uint32_t ucSavedSeamlessRgn = pFBInfo->mcSavedVisibleRegion;
     843        SaveSeamlessRectUnLock();
     844        if (pSavedSeamlessRgn && ucSavedSeamlessRgn)
     845        {
     846            handleSetVisibleRegion(ucSavedSeamlessRgn, pSavedSeamlessRgn);
    842847            SaveSeamlessRectLock();
    843848            if (pFBInfo->mpSavedVisibleRegion)
     
    11281133                    RTMemFree(pFBInfo->mpSavedVisibleRegion);
    11291134               
    1130                 pFBInfo->mpSavedVisibleRegion = (RTRECT *)RTMemTmpAlloc( RT_MAX(cRect, 1)
    1131                                                                         * sizeof (RTRECT));
     1135                pFBInfo->mpSavedVisibleRegion = (RTRECT *)RTMemAlloc( RT_MAX(cRect, 1)
     1136                                                                     * sizeof (RTRECT));
    11321137                if (pFBInfo->mpSavedVisibleRegion)
    11331138                {
    11341139                    memcpy(pFBInfo->mpSavedVisibleRegion, pRect, cRect * sizeof(RTRECT));
    11351140                    pFBInfo->mcSavedVisibleRegion = cRect;
     1141                }
     1142                else
     1143                {
     1144                    /* memory allocation failed */
     1145                    pFBInfo->mcSavedVisibleRegion = 0;
    11361146                }
    11371147                SaveSeamlessRectUnLock();
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