Browse Source

fixed memory leak, ICU libraries are now optional

naelstrof 6 years ago
parent
commit
1984fec136
2 changed files with 4 additions and 3 deletions
  1. 3
    3
      CMakeLists.txt
  2. 1
    0
      src/x.cpp

+ 3
- 3
CMakeLists.txt View File

@@ -79,10 +79,10 @@ target_link_libraries(${LIBRARY_NAME} ${X11_LIBRARIES}
79 79
 
80 80
 target_link_libraries(${EXECUTABLE_NAME} ${LIBRARY_NAME} )
81 81
 
82
-set( SLOP_UNICODE TRUE CACHE BOOL "To enable or disable unicode support, really should be left to TRUE since old nvidia drivers crash with it off." )
83
-if ( SLOP_UNICODE )
82
+find_package(ICU COMPONENTS uc)
83
+set( SLOP_UNICODE TRUE CACHE BOOL "To enable or disable unicode support." )
84
+if ( SLOP_UNICODE AND ICU_FOUND )
84 85
     # ICU is required for old nvidia drivers to work for whatever reason.
85
-    find_package(ICU REQUIRED COMPONENTS uc)
86 86
     add_definitions(-DCXXOPTS_USE_UNICODE)
87 87
     include_directories( ${ICU_INCLUDE_DIR} )
88 88
     target_link_libraries(${EXECUTABLE_NAME} ${ICU_UC_LIBRARIES} )

+ 1
- 0
src/x.cpp View File

@@ -60,6 +60,7 @@ glm::vec4 slop::getWindowGeometry( Window win, bool removeDecoration ) {
60 60
         height += ldata[2] + ldata[3];
61 61
         x -= ldata[0];
62 62
         y -= ldata[2];
63
+        XFree( data );
63 64
         return glm::vec4( x, y, width, height );
64 65
     } else {
65 66
         // Either the WM is malfunctioning, or the window specified isn't a window manager frame.