mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2026-10-27 06:21:36 +00:00
Merge pull request #524 from mikeysklar/gfx-virtual-destructor
Free canvas memory when deleted through an Adafruit_GFX pointer
This commit is contained in:
1 file changed
+5
@@ -19,6 +19,11 @@ class Adafruit_GFX : public Print {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Adafruit_GFX(int16_t w, int16_t h); // Constructor
|
Adafruit_GFX(int16_t w, int16_t h); // Constructor
|
||||||
|
#if !defined(__AVR__)
|
||||||
|
// Virtual so deleting a canvas or display through an Adafruit_GFX pointer
|
||||||
|
// frees it. Skipped on AVR, where it links malloc/free into every sketch.
|
||||||
|
virtual ~Adafruit_GFX() {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
Reference in new issue
Block a user