We play weird ownership games with SignalTextChanged, and we don't know why #18349

Open
opened 2026-01-31 06:11:11 +00:00 by claunia · 1 comment
Owner

Originally created by @zadjii-msft on GitHub (Sep 1, 2022).

See context: #13876, MSFT:39994969

See discussion:

I'm not really in favor of this PR. There shouldn't be situation to begin with were NVDA calls us and the existence of TermControl is the make/break of whether WT crashes... As such I'd prefer fixing whatever UIA APIs we have that might crash WT, including any assumptions we have that WinUI won't suddenly call AppHost::~AppHost despite being 50 calls deep in the stack.

Should we file a workitem to fix this more soundly? Should we take this as a "stopgap" until we can fix it more soundly?

Maybe I was too terse. 😄 I'm in favor of merging this, just not in favor of this PR because it's a stopgap. I think we should just continue to work on cleaning up our pointer safety and data sharing behavior. Maybe even do it consciously at some point instead of doing it on a case by case basis. IMO we should remove any use of this (including implicit use) if it can be avoided and find and if possible remove implicit recursion like this one were class X calls Y which calls back into X (e.g. introduce class Z which is used by both X and Y, removing the need for recursion).

Maybe even do it consciously at some point instead of doing it on a case by case basis.

YES

Originally created by @zadjii-msft on GitHub (Sep 1, 2022). See context: #13876, [MSFT:39994969](https://task.ms/39994969) See discussion: > I'm not really in favor of this PR. There shouldn't be situation to begin with were NVDA calls us and the existence of `TermControl` is the make/break of whether WT crashes... As such I'd prefer fixing whatever UIA APIs we have that might crash WT, including any assumptions we have that WinUI won't suddenly call `AppHost::~AppHost` despite being 50 calls deep in the stack. > > Should we file a workitem to fix this more soundly? Should we take this as a "stopgap" until we can fix it more soundly? > > Maybe I was too terse. 😄 I'm in favor of merging this, just not in favor of this PR because it's a stopgap. I think we should just continue to work on cleaning up our pointer safety and data sharing behavior. Maybe even do it consciously at some point instead of doing it on a case by case basis. IMO we should remove any use of `this` (including implicit use) if it can be avoided and find and if possible remove implicit recursion like this one were class X calls Y which calls back into X (e.g. introduce class Z which is used by both X and Y, removing the need for recursion). > > Maybe even do it consciously at some point instead of doing it on a case by case basis. > > YES
Author
Owner

@zadjii-msft commented on GitHub (Oct 26, 2022):

See also #13978

@zadjii-msft commented on GitHub (Oct 26, 2022): See also #13978
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18349