From 0cd9ee9d5bb12e4404792da3541f0e50fdb2e26b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 26 Dec 2014 17:03:06 -0500 Subject: [PATCH] lib/socket: `PollFD` is `FinalizableOnce` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/socket/socket_c.nit | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/socket/socket_c.nit b/lib/socket/socket_c.nit index 793b1c5..ba76860 100644 --- a/lib/socket/socket_c.nit +++ b/lib/socket/socket_c.nit @@ -37,6 +37,7 @@ in "C" `{ # Wrapper for the data structure PollFD used for polling on a socket class PollFD + super FinalizableOnce # The PollFD object private var poll_struct: NativeSocketPollFD @@ -76,6 +77,10 @@ class PollFD return response & mask; `} + redef fun finalize_once + do + poll_struct.free + end end # Data structure used by the poll function -- 1.7.9.5