瀏覽代碼

V1 macos freeze fix 1683 (#2668)

* Fixes #1683. The application freezes while resizing the terminal on MacOS

* Remove unused variable.
BDisp 2 年之前
父節點
當前提交
22cf4e3274
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

+ 2 - 1
Terminal.Gui/ConsoleDrivers/CursesDriver/UnixMainLoop.cs

@@ -82,6 +82,7 @@ namespace Terminal.Gui {
 		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 @@ namespace Terminal.Gui {
 			this.mainLoop = mainLoop;
 			pipe (wakeupPipes);
 			AddWatch (wakeupPipes [0], Condition.PollIn, ml => {
-				read (wakeupPipes [0], ignore, (IntPtr)1);
+				read (wakeupPipes [0], ignore, readHandle);
 				return true;
 			});
 		}