Skip to content

Commit 4260537

Browse files
authored
fix(ffi): avoid infinite loop in HandleClipboardEvents when not on Windows (#846)
When running on non-Windows, HandleClipboardEvents will create an infinite loop consuming 100% CPU. Now, we call HandleClipboardEvents only when on Windows.
1 parent 76a2a0b commit 4260537

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ffi/dotnet/Devolutions.IronRdp.AvaloniaExample/MainWindow.axaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ private void OnOpened(object? sender, EventArgs e)
112112
this._activeStage = ActiveStage.New(res);
113113
this._framed = framed;
114114
ReadPduAndProcessActiveStage();
115-
HandleClipboardEvents();
115+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
116+
{
117+
HandleClipboardEvents();
118+
}
116119
});
117120
}
118121

0 commit comments

Comments
 (0)