Jelajahi Sumber

V1 macos freeze fix 1683 (#2668)

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

* Remove unused variable.
BDisp 2 tahun lalu
induk
melakukan
22cf4e3274
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  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;
 			});
 		}