Browse Source

fixed memory leak, ICU libraries are now optional

naelstrof 7 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
 
79
 
80
 target_link_libraries(${EXECUTABLE_NAME} ${LIBRARY_NAME} )
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
     # ICU is required for old nvidia drivers to work for whatever reason.
85
     # ICU is required for old nvidia drivers to work for whatever reason.
85
-    find_package(ICU REQUIRED COMPONENTS uc)
86
     add_definitions(-DCXXOPTS_USE_UNICODE)
86
     add_definitions(-DCXXOPTS_USE_UNICODE)
87
     include_directories( ${ICU_INCLUDE_DIR} )
87
     include_directories( ${ICU_INCLUDE_DIR} )
88
     target_link_libraries(${EXECUTABLE_NAME} ${ICU_UC_LIBRARIES} )
88
     target_link_libraries(${EXECUTABLE_NAME} ${ICU_UC_LIBRARIES} )

+ 1
- 0
src/x.cpp View File

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