diff --git a/Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs b/Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs index df53595428..44ebb4b27c 100644 --- a/Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs +++ b/Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs @@ -82,6 +82,7 @@ class Watch { bool poll_dirty = true; int [] wakeupPipes = new int [2]; static IntPtr ignore = Marshal.AllocHGlobal (1); + static IntPtr readHandle = Marshal.AllocHGlobal (1); MainLoop mainLoop; bool winChanged; @@ -97,7 +98,7 @@ void IMainLoopDriver.Setup (MainLoop mainLoop) this.mainLoop = mainLoop; pipe (wakeupPipes); AddWatch (wakeupPipes [0], Condition.PollIn, ml => { - read (wakeupPipes [0], ignore, (IntPtr)1); + var result = read (wakeupPipes [0], ignore, readHandle); return true; }); }