Skip to content

[Rust][Game] Wrap game ownership with RAII #232

Description

@utilForever

Parent: #137

Goal

Provide a safe Game type that creates, loads, resets, seeds, and destroys the opaque native handle.

Scope

  • Make Drop release the handle exactly once
  • Prevent safe use after move or destruction
  • Represent setup failures as Result

Non-goals

  • Shared ownership without a use case
  • Exposing raw handles in normal APIs
  • Global mutable game state

Acceptance criteria

  • Safe callers never invoke destroy manually.
  • Move and early-error paths do not leak or double free.
  • Multiple Game values remain independent.

Verification

Run lifecycle, failed-construction, move, and multiple-game tests under available memory diagnostics.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions