clean up last commit by sharing coding via modify_{front,end}
[ardour.git] / libs / gtkmm2ext / fastmeter.cc
index cad900d8edf4c7759075b49a21b59c1d644cb3b1..f13236271d64278482f2cce0d381bc263a5bcb08 100644 (file)
@@ -25,7 +25,7 @@
 #include <gtkmm2ext/fastmeter.h>
 #include <gtkmm2ext/utils.h>
 #include <gtkmm/style.h>
-#include <string.h>
+#include <cstring>
 
 #define UINT_TO_RGB(u,r,g,b) { (*(r)) = ((u)>>16)&0xff; (*(g)) = ((u)>>8)&0xff; (*(b)) = (u)&0xff; }
 #define UINT_TO_RGBA(u,r,g,b,a) { UINT_TO_RGB(((u)>>8),r,g,b); (*(a)) = (u)&0xff; }
@@ -517,7 +517,7 @@ FastMeter::queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>& win, float ol
                rect.height = pixrect.height - rect.height;
        }
 
-       GdkRegion* region;
+       GdkRegion* region = 0;
        bool queue = false;
 
        if (rect.height != 0) {
@@ -544,6 +544,10 @@ FastMeter::queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>& win, float ol
        if (queue) {
                gdk_window_invalidate_region (win->gobj(), region, true);
        }
+       if (region) {
+               gdk_region_destroy(region);
+               region = 0;
+       }
 }
 
 void