Changeset 41913 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Jun 25, 2012 3:56:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
r41865 r41913 264 264 - (NSView*)dockTileScreen; 265 265 - (void)reshapeDockTile; 266 - (void)cleanupData; 266 267 @end 267 268 … … 669 670 } 670 671 671 - (void)dealloc 672 { 673 DEBUG_MSG(("OVIW(%p): dealloc OverlayView\n", (void*)self)); 674 672 - (void)cleanupData 673 { 675 674 [self deleteFBO]; 676 675 … … 679 678 if ([m_pGLCtx view] == self) 680 679 [m_pGLCtx clearDrawable]; 680 681 m_pGLCtx = nil; 681 682 } 682 683 if (m_pSharedGLCtx) … … 686 687 687 688 [m_pSharedGLCtx release]; 689 690 m_pSharedGLCtx = nil; 688 691 } 689 692 690 693 [self clearVisibleRegions]; 694 } 695 696 - (void)dealloc 697 { 698 DEBUG_MSG(("OVIW(%p): dealloc OverlayView\n", (void*)self)); 699 700 [self cleanupData]; 691 701 692 702 [super dealloc]; … … 701 711 { 702 712 DEBUG_MSG(("OVIW(%p): setGLCtx: new ctx: %p\n", (void*)self, (void*)pCtx)); 713 if (m_pGLCtx == pCtx) 714 return; 715 716 /* ensure the context drawable is cleared to avoid holding a reference to inexistent view */ 717 if (m_pGLCtx) 718 [m_pGLCtx clearDrawable]; 703 719 704 720 m_pGLCtx = pCtx; … … 1779 1795 [pWin setContentView: nil]; 1780 1796 [[pWin parentWindow] removeChildWindow: pWin]; 1797 1781 1798 /* 1782 1799 a = [pWin retainCount]; … … 1784 1801 [pWin performSelector:@selector(release)] 1785 1802 */ 1803 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1804 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1805 and main hgcm thread waiting for us, this is why use waitUntilDone:NO, 1806 which should cause no harm */ 1786 1807 [pWin performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO]; 1787 1808 /* 1788 1809 [pWin release]; 1789 1810 */ 1811 1812 /* We can NOT run synchronously with the main thread since this may lead to a deadlock, 1813 caused by main thread waiting xpcom thread, xpcom thread waiting to main hgcm thread, 1814 and main hgcm thread waiting for us, this is why use waitUntilDone:NO. 1815 We need to avoid concurrency though, so we cleanup some data right away via a cleanupData call */ 1816 [(OverlayView*)pView cleanupData]; 1790 1817 1791 1818 /* There seems to be a bug in the performSelector method which is called in
Note:
See TracChangeset
for help on using the changeset viewer.