diff --git a/Fltk/drawContextFltkCairo.cpp b/Fltk/drawContextFltkCairo.cpp
index 84f393e5d508dca5675c1ab5abdb79de7e3f9ce3..9e6595c091fd2eb8ad01d9851e5c191e413629fe 100644
--- a/Fltk/drawContextFltkCairo.cpp
+++ b/Fltk/drawContextFltkCairo.cpp
@@ -56,6 +56,7 @@ class drawContextFltkCairo::queueString {
 
   void flush()
   {
+    if(_elements.empty()) return;
     cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_A8, _totalWidth, _maxHeight);
     cairo_t *cr = cairo_create(surface);
     int pos = 0;
diff --git a/Fltk/drawContextFltkStringTexture.cpp b/Fltk/drawContextFltkStringTexture.cpp
index b8553058354580ec459f19d4974395486f9863c0..fc4ebb51ca9ee165473ae7efa076b37be680d0fb 100644
--- a/Fltk/drawContextFltkStringTexture.cpp
+++ b/Fltk/drawContextFltkStringTexture.cpp
@@ -45,7 +45,6 @@ class drawContextFltkStringTexture::queueString {
   void flush()
   {
     if(_elements.empty()) return;
-
     //1000 should be _totalWidth but it does not work
     int w = 1000, h = _maxHeight;
     Fl_Offscreen offscreen = fl_create_offscreen(w, h);