vbox5: free bitmap source during resize

Fixes #3216
This commit is contained in:
Alexander Boettcher 2019-03-07 17:41:28 +01:00 committed by Norman Feske
parent 800b4e44b1
commit ce1f245952
3 changed files with 45 additions and 1 deletions

View File

@ -1 +1 @@
48495db3bf857e7d02ede435d53904ac5239d91d
1544b2568499a11bfd400f6bb1361e39f9f1022d

View File

@ -0,0 +1,43 @@
--- a/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h
+++ b/src/app/virtualbox/src/VBox/Main/include/DisplayImpl.h
@@ -35,6 +35,7 @@
#define NEW_RESIZE
+class DisplaySourceBitmap;
class Console;
struct VIDEORECCONTEXT;
@@ -50,7 +51,7 @@
ComPtr<IFramebuffer> pFramebuffer;
com::Guid framebufferId;
- ComPtr<IDisplaySourceBitmap> pSourceBitmap;
+ ComPtr<DisplaySourceBitmap> pSourceBitmap;
bool fDisabled;
uint32_t u32Caps;
--- a/src/app/virtualbox/src/VBox/Main/include/TokenImpl.h
+++ b/src/app/virtualbox/src/VBox/Main/include/TokenImpl.h
@@ -22,6 +22,7 @@
#include "TokenWrap.h"
#include "MachineImpl.h"
+#include "MediumImpl.h"
/**
--- a/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp
+++ b/src/app/virtualbox/src/VBox/Main/src-client/DisplayImpl.cpp
@@ -1071,6 +1073,11 @@
pFBInfo->updateImage.cbLine = 0;
/* Release the current source bitmap. */
+ DisplaySourceBitmap *source_bitmap = *pFBInfo->pSourceBitmap.asOutParam();
+ if (source_bitmap) {
+ source_bitmap->FinalRelease();
+ delete source_bitmap;
+ }
pFBInfo->pSourceBitmap.setNull();
/* Update the video mode information. */

View File

@ -31,3 +31,4 @@ vmdk.patch
tm_tpr.patch
tm_4s.patch
rem_tss.patch
mem_leak.patch