فهرست منبع

use X11.XFree instead of libc.free

Fabian Peter Hammerle 7 سال پیش
والد
کامیت
5d9ebd2699
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      scripts/xrandrl

+ 2 - 4
scripts/xrandrl

@@ -6,7 +6,6 @@ https://cgit.freedesktop.org/xorg/app/xrandr/tree/xrandr.c
 """
 
 import ctypes
-import ctypes.util
 
 X_Time = ctypes.c_ulong
 """
@@ -115,7 +114,6 @@ X11 = ctypes.cdll.LoadLibrary("libX11.so")
 Xrandr = ctypes.cdll.LoadLibrary("libXrandr.so")
 Xrandr.XRRGetScreenResourcesCurrent.restype = \
     ctypes.POINTER(X_XRRScreenResources)
-libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
 """
 XRROutputInfo *
 XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output);
@@ -130,7 +128,7 @@ class RandrScreenResources:
         self._p = Xrandr.XRRGetScreenResourcesCurrent(xdisplay, window)
 
     def __del__(self):
-        libc.free(self._p)
+        X11.XFree(self._p)
 
     @property
     def outputs(self):
@@ -150,7 +148,7 @@ class RandrOutputInfo:
         )
 
     def __del__(self):
-        libc.free(self._p)
+        X11.XFree(self._p)
 
     @property
     def enabled(self):