mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#939
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/1Remote/1Remote/pull/1008
Author: @Copilot
Created: 10/19/2025
Status: ✅ Merged
Merged: 10/19/2025
Merged by: @VShawn
Base:
main← Head:copilot/fix-issue-937-and-verify📝 Commits (3)
fba9271Initial plan1e0acf5Fix RDP client disposal race condition in Microsoft Store version3bbedfaUse dedicated lock object instead of lock(this) for RDP disposal📊 Changes
1 file changed (+25 additions, -21 deletions)
View changed files
📝
Ui/View/Host/ProtocolHosts/AxMsRdpClient09Host.xaml.cs(+25 -21)📄 Description
Problem
Issue #937 reported that the Microsoft Store version 1.2.0 crashes after RDP connections, while the sideloaded package works correctly. Investigation revealed a critical race condition in the RDP client disposal logic that was exposed more frequently by the Microsoft Store version's threading characteristics.
Root Cause
The
RdpClientDispose()method inAxMsRdpClient09Host.xaml.csused asynchronous disposal viaExecute.OnUIThread(), which allowed code execution to continue before the RDP client was fully disposed. This created several race conditions:Race condition scenarios:
ReConn()callsRdpClientDispose()then immediately attempts to create a new RDP connection before the old client is fully disposedRdpClientDispose()then invokesOnClosedcallback before disposal completesThe log message "RDP Host: _rdpClient.Disposed." was printing before actual disposal completed, masking the timing issue.
Solution
Changed to synchronous disposal to ensure the RDP client is fully disposed before any subsequent operations:
Additionally, introduced a dedicated lock object
_rdpClientDisposeLockto ensure thread-safe access during creation and disposal, replacing thelock(this)pattern which can lead to deadlocks.Changes
Execute.OnUIThread()toExecute.OnUIThreadSync()inRdpClientDispose()for synchronous disposalprivate readonly object _rdpClientDisposeLockfor thread-safe disposalDisposeRdpClient(),CreateRdpClient(), andOnScreenResolutionChanged()to use the dedicated lockImpact
These minimal, surgical changes ensure:
Testing
Due to the WPF/Windows-specific nature of this code, testing requires a Windows environment. Recommended test scenarios:
Fixes #937
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.