Files
WerkoutIOS/docs/step9_memory_lifecycle_round1.md

1.5 KiB

Step 9 Memory/Lifecycle Round 1

Coverage

  • Audited lifecycle cleanup and resource teardown in:
    • iphone/Werkout_ios/subview/PlayerUIView.swift
    • iphone/Werkout_ios/Views/WorkoutDetail/WorkoutDetailView.swift
    • iphone/Werkout_ios/Views/WorkoutDetail/ExerciseListView.swift
    • iphone/Werkout_ios/Views/ExternalWorkoutDetailView.swift
    • iphone/Werkout_ios/subview/AllExerciseView.swift
    • iphone/Werkout_ios/Views/CreateWorkout/CreateExerciseActionsView.swift
    • iphone/Werkout_ios/AudioEngine.swift
    • WekoutThotViewer/WekoutThotViewer/ContentView.swift
  • Validation:
    • ./scripts/smoke/smoke_all.sh

Fixes

  1. Player view teardown safety

    • PlayerView now pauses previous players when swapping and performs explicit teardown in dismantleUIView.
  2. Workout detail closure retention risk

    • Clears BridgeModule.shared.completedWorkout on WorkoutDetailView disappear.
  3. Player pause on dismiss across views

    • Added onDisappear player pause in workout detail exercise list, create-exercise preview, all-exercise preview, external display, and tvOS content view.
  4. External display player reuse

    • Added URL tracking + replay path to avoid reallocating AVPlayer when URL is unchanged.
  5. Audio playback resource churn

    • Stops existing players before replacement and logs failures via RuntimeReporter instead of print.

Validation

  • Smoke suite passed:
    • token scan
    • SharedCore tests
    • iOS/watchOS/tvOS builds