From 2b6bad6a239069500432ac269d49340ace5eb1f4 Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Wed, 10 Mar 2010 18:03:04 +0100 Subject: Flash in browser workaround --- overlay/d3d9.cpp | 5 ++++- overlay/lib.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'overlay') diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp index 3e9768206..85249b582 100644 --- a/overlay/d3d9.cpp +++ b/overlay/d3d9.cpp @@ -42,7 +42,7 @@ struct D3DTLVERTEX { }; static const DWORD D3DFVF_TLVERTEX = D3DFVF_XYZRHW | D3DFVF_TEX1; -class DevState : protected Pipe { +class DevState : public Pipe { public: IDirect3DDevice9 *dev; IDirect3DStateBlock9 *pSB; @@ -429,6 +429,9 @@ static ULONG __stdcall myRelease(IDirect3DDevice9 *idd) { ds->refCount--; } + if (ds->refCount <= 1) + ds->disconnect(); + if (ds->refCount >= 0) return ds->refCount + ds->initRefCount; diff --git a/overlay/lib.h b/overlay/lib.h index f06b32957..43427f04a 100644 --- a/overlay/lib.h +++ b/overlay/lib.h @@ -96,7 +96,6 @@ class Pipe { HANDLE hMemory; void release(); - void disconnect(); protected: unsigned int uiWidth, uiHeight; unsigned int uiLeft, uiTop, uiRight, uiBottom; @@ -111,6 +110,8 @@ class Pipe { virtual void newTexture(unsigned int w, unsigned int h) = 0; Pipe(); ~Pipe(); + public: + void disconnect(); }; extern void checkDXGIHook(bool preonly = false); -- cgit v1.2.3