Skip to content

fix duel::clear, add interpreter::unregister_card#826

Merged
mercury233 merged 3 commits into
Fluorohydride:masterfrom
mercury233:patch-copilot-3
Mar 13, 2026
Merged

fix duel::clear, add interpreter::unregister_card#826
mercury233 merged 3 commits into
Fluorohydride:masterfrom
mercury233:patch-copilot-3

Conversation

@mercury233

@mercury233 mercury233 commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator

duel::clear is currently only called in Debug.ReloadFieldBegin. At that case, there should be only 1 card in the cards set, which is temp_card, and nothing in groups or effects. This fix prevent the leak of the temp card.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts duel::clear() to properly detach Lua-exposed objects before freeing them, preventing Lua from retaining stale references across duel reload/reset operations.

Changes:

  • Unregister group objects from the Lua registry before deleting them during duel::clear().
  • Unregister effect objects from the Lua registry before deleting them during duel::clear().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread duel.cpp Outdated
@mercury233 mercury233 marked this pull request as draft March 7, 2026 07:35
@mercury233 mercury233 changed the title fix duel::clear fix duel::clear, add interpreter::unregister_card Mar 7, 2026
@mercury233 mercury233 requested a review from Copilot March 7, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mercury233 mercury233 marked this pull request as ready for review March 7, 2026 09:14
@mercury233 mercury233 merged commit 25694cc into Fluorohydride:master Mar 13, 2026
3 of 4 checks passed
@mercury233 mercury233 deleted the patch-copilot-3 branch March 13, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants