From 52d0462aa5252f1728db5ace5ed17cb3af94d6c6 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 28 Jul 2018 14:18:04 +0200 Subject: [PATCH] Fix closing empty subpath (Core Graphics) CGPathCloseSubpath() shouldn't be invoked if the path is empty to suppress harmless warning displayed on console. --- src/osx/carbon/graphics.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 01a54e106a..5569691a93 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1240,7 +1240,10 @@ void wxMacCoreGraphicsPathData::AddPath( const wxGraphicsPathData* path ) // closes the current subpath void wxMacCoreGraphicsPathData::CloseSubpath() { - CGPathCloseSubpath( m_path ); + if ( !CGPathIsEmpty(m_path) ) + { + CGPathCloseSubpath( m_path ); + } } // gets the last point of the current path, (0,0) if not yet set