Browse Source

Add leak detectors to DGL classes

gh-pages
falkTX 10 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 _oneShown();
void _oneHidden();

DISTRHO_LEAK_DETECTOR(App)
};

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


+ 1
- 1
dgl/Base.hpp View File

@@ -17,7 +17,7 @@
#ifndef 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_surface_t* fSurface;
GLuint fTextureId;

DISTRHO_LEAK_DETECTOR(CairoWidget)
};

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


+ 9
- 0
dgl/Geometry.hpp View File

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

DISTRHO_LEAK_DETECTOR(Point)
DISTRHO_PREVENT_HEAP_ALLOCATION
};

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

DISTRHO_LEAK_DETECTOR(Size)
DISTRHO_PREVENT_HEAP_ALLOCATION
};

// -----------------------------------------------------------------------
@@ -124,6 +130,9 @@ public:
private:
Point<T> fPos;
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 fType;
GLuint fTextureId;

DISTRHO_LEAK_DETECTOR(Image)
DISTRHO_PREVENT_HEAP_ALLOCATION
};

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


+ 2
- 0
dgl/ImageAboutWindow.hpp View File

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

private:
Image fImgBackground;

DISTRHO_LEAK_DETECTOR(ImageAboutWindow)
};

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


+ 2
- 0
dgl/ImageButton.hpp View File

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

Callback* fCallback;

DISTRHO_LEAK_DETECTOR(ImageButton)
};

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


+ 2
- 0
dgl/ImageKnob.hpp View File

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

DISTRHO_LEAK_DETECTOR(ImageKnob)
};

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


+ 2
- 0
dgl/ImageSlider.hpp View File

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

void _recheckArea();

DISTRHO_LEAK_DETECTOR(ImageSlider)
};

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


+ 2
- 0
dgl/StandaloneWindow.hpp View File

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

DISTRHO_LEAK_DETECTOR(StandaloneWindow)
};

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


+ 2
- 0
dgl/Widget.hpp View File

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

friend class CairoWidget;
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 _removeWidget(Widget* const widget);
void _idle();

DISTRHO_LEAK_DETECTOR(Window)
};

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


Loading…
Cancel
Save