Permalink
Browse files

Followup on [9b23866]. Use reference counting in MythD3D9Painter.

  • Loading branch information...
daniel-kristjansson committed Jun 7, 2012
1 parent c5803f1 commit a9b46b72677b8a3ee97767b2311e2749009a2498
Showing with 3 additions and 7 deletions.
  1. +3 −6 mythtv/libs/libmythui/mythpainter_d3d9.cpp
  2. +0 −1 mythtv/libs/libmythui/mythpainter_d3d9.h
@@ -12,11 +12,11 @@
#define LOC QString("D3D9 Painter: ")
MythD3D9Painter::MythD3D9Painter(MythRenderD3D9 *render) :
- MythPainter(), m_render(render), m_created_render(true), m_target(NULL),
+ MythPainter(), m_render(render), m_target(NULL),
m_swap_control(true)
{
if (m_render)
- m_created_render = false;
+ m_render->IncrRef();
}
MythD3D9Painter::~MythD3D9Painter()
@@ -37,7 +37,6 @@ bool MythD3D9Painter::InitD3D9(QPaintDevice *parent)
if (!m_render)
return false;
- m_created_render = true;
if (m_render->Create(real_parent->size(), real_parent->winId()))
return true;
@@ -57,9 +56,7 @@ void MythD3D9Painter::Teardown(void)
if (m_render)
{
- if (m_created_render)
- delete m_render;
- m_created_render = true;
+ m_render->DecrRef();
m_render = NULL;
}
}
@@ -41,7 +41,6 @@ class MUI_PUBLIC MythD3D9Painter : public MythPainter
D3D9Image* GetImageFromCache(MythImage *im);
MythRenderD3D9 *m_render;
- bool m_created_render;
D3D9Image *m_target;
bool m_swap_control;
QMap<MythImage *, D3D9Image*> m_ImageBitmapMap;

0 comments on commit a9b46b7

Please sign in to comment.