Browse Source

Add leak detectors to DGL classes

gh-pages
falkTX 11 years ago
parent
commit
4edacd6c7b
12 changed files with 31 additions and 1 deletions
  1. +2
    -0
      dgl/App.hpp
  2. +1
    -1
      dgl/Base.hpp
  3. +2
    -0
      dgl/CairoWidget.hpp
  4. +9
    -0
      dgl/Geometry.hpp
  5. +3
    -0
      dgl/Image.hpp
  6. +2
    -0
      dgl/ImageAboutWindow.hpp
  7. +2
    -0
      dgl/ImageButton.hpp
  8. +2
    -0
      dgl/ImageKnob.hpp
  9. +2
    -0
      dgl/ImageSlider.hpp
  10. +2
    -0
      dgl/StandaloneWindow.hpp
  11. +2
    -0
      dgl/Widget.hpp
  12. +2
    -0
      dgl/Window.hpp

+ 2
- 0
dgl/App.hpp View File

@@ -55,6 +55,8 @@ private:
void _removeWindow(Window* const window); void _removeWindow(Window* const window);
void _oneShown(); void _oneShown();
void _oneHidden(); void _oneHidden();

DISTRHO_LEAK_DETECTOR(App)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 1
- 1
dgl/Base.hpp View File

@@ -17,7 +17,7 @@
#ifndef DGL_BASE_HPP_INCLUDED #ifndef DGL_BASE_HPP_INCLUDED
#define DGL_BASE_HPP_INCLUDED #define DGL_BASE_HPP_INCLUDED


#include "../distrho/src/DistrhoDefines.h"
#include "../distrho/extra/d_leakdetector.hpp"


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------




+ 2
- 0
dgl/CairoWidget.hpp View File

@@ -197,6 +197,8 @@ private:
cairo_t* fContext; cairo_t* fContext;
cairo_surface_t* fSurface; cairo_surface_t* fSurface;
GLuint fTextureId; GLuint fTextureId;

DISTRHO_LEAK_DETECTOR(CairoWidget)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 9
- 0
dgl/Geometry.hpp View File

@@ -49,6 +49,9 @@ public:
private: private:
T fX, fY; T fX, fY;
template<typename> friend class Rectangle; template<typename> friend class Rectangle;

DISTRHO_LEAK_DETECTOR(Point)
DISTRHO_PREVENT_HEAP_ALLOCATION
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -78,6 +81,9 @@ public:
private: private:
T fWidth, fHeight; T fWidth, fHeight;
template<typename> friend class Rectangle; template<typename> friend class Rectangle;

DISTRHO_LEAK_DETECTOR(Size)
DISTRHO_PREVENT_HEAP_ALLOCATION
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -124,6 +130,9 @@ public:
private: private:
Point<T> fPos; Point<T> fPos;
Size<T> fSize; Size<T> fSize;

DISTRHO_LEAK_DETECTOR(Rectangle)
DISTRHO_PREVENT_HEAP_ALLOCATION
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 3
- 0
dgl/Image.hpp View File

@@ -59,6 +59,9 @@ private:
GLenum fFormat; GLenum fFormat;
GLenum fType; GLenum fType;
GLuint fTextureId; GLuint fTextureId;

DISTRHO_LEAK_DETECTOR(Image)
DISTRHO_PREVENT_HEAP_ALLOCATION
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/ImageAboutWindow.hpp View File

@@ -47,6 +47,8 @@ protected:


private: private:
Image fImgBackground; Image fImgBackground;

DISTRHO_LEAK_DETECTOR(ImageAboutWindow)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/ImageButton.hpp View File

@@ -55,6 +55,8 @@ private:
int fCurButton; int fCurButton;


Callback* fCallback; Callback* fCallback;

DISTRHO_LEAK_DETECTOR(ImageButton)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/ImageKnob.hpp View File

@@ -83,6 +83,8 @@ private:
int fImgLayerCount; int fImgLayerCount;
Rectangle<int> fKnobArea; Rectangle<int> fKnobArea;
GLuint fTextureId; GLuint fTextureId;

DISTRHO_LEAK_DETECTOR(ImageKnob)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/ImageSlider.hpp View File

@@ -77,6 +77,8 @@ private:
Rectangle<int> fSliderArea; Rectangle<int> fSliderArea;


void _recheckArea(); void _recheckArea();

DISTRHO_LEAK_DETECTOR(ImageSlider)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/StandaloneWindow.hpp View File

@@ -70,6 +70,8 @@ public:
protected: protected:
App fApp; App fApp;
Window fWindow; Window fWindow;

DISTRHO_LEAK_DETECTOR(StandaloneWindow)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/Widget.hpp View File

@@ -97,6 +97,8 @@ private:


friend class CairoWidget; friend class CairoWidget;
friend class Window; friend class Window;

DISTRHO_LEAK_DETECTOR(Widget)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


+ 2
- 0
dgl/Window.hpp View File

@@ -77,6 +77,8 @@ private:
void _addWidget(Widget* const widget); void _addWidget(Widget* const widget);
void _removeWidget(Widget* const widget); void _removeWidget(Widget* const widget);
void _idle(); void _idle();

DISTRHO_LEAK_DETECTOR(Window)
}; };


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------


Loading…
Cancel
Save