Skip to content

Commit 224ae14

Browse files
committed
Fix memory leaks
1 parent 1366720 commit 224ae14

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/os/posix/x11.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ impl DisplayInfo {
160160
conv_depth = pix_fmt.bits_per_pixel;
161161
}
162162
}
163+
164+
(self.lib.XFree)(formats as _);
163165
}
164166

165167
if conv_depth != 32 {
@@ -237,6 +239,7 @@ impl DisplayInfo {
237239
impl Drop for DisplayInfo {
238240
fn drop(&mut self) {
239241
unsafe {
242+
(self.lib.XFreeGC)(self.display, self.gc);
240243
(self.lib.XCloseDisplay)(self.display);
241244
}
242245
}

0 commit comments

Comments
 (0)