Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix target object emit #125

Merged
merged 3 commits into from
Sep 14, 2024
Merged

Fix target object emit #125

merged 3 commits into from
Sep 14, 2024

Conversation

maxkatz6
Copy link
Collaborator

@maxkatz6 maxkatz6 commented Sep 14, 2024

Reported multiple times before
Fixes: #7
Fixes: AvaloniaUI/Avalonia#4601
Fixes: internal ticket 242

Old code gen:

public void PopParent()
{
	int idx = _parents.Count - 1;
	_target = _parents[idx]; // keeps reference of the old and already removed parent
	_parents.RemoveAt(idx);
}

New code gen:

public void PopParent()
{
        var idx = _parents.Count - 1;
        _parents.RemoveAt(idx);
        _target = idx != 0 ? _parents[idx - 1] : null;
}

@maxkatz6 maxkatz6 added the bug Something isn't working label Sep 14, 2024
@kekekeks kekekeks merged commit e524acf into master Sep 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants