Skill Details
Runtime
(gpt-5.6)
Example user message
[userMessage]: My desktop app crashes whenever I close a project after importing an image. Here is the stack trace and the relevant C++ code. Please find the actual root cause and give me the smallest safe fix.
Example agent response
## Bug Summary
**Expected:** Closing the project releases imported image resources and returns to the start screen.
**Actual:** The application crashes during project shutdown.
**Trigger:** Import image → close project.
**Affected Area:** Resource ownership / project cleanup.
**Bug Type:** Lifetime and double-destruction issue.
## Evidence
### Confirmed
* The crash occurs inside image resource destruction.
* The imported texture is destroyed during project cleanup.
* The same texture pointer is also owned by the image cache.
### Indicators
* Projects without imported images close normally.
* The crash only appears after the imported texture has been registered in both containers.
## Failure Path
```text
Import image
↓
Create texture
↓
Store same texture in project object and shared cache
↓
Close project
↓
Project destroys texture
↓
Cache later destroys same texture again
↓
Invalid resource access / crash
```
## Root Cause
**Root Cause:** The imported texture has two owners, but both code paths assume exclusive ownership.
**Failure Mechanism:** Project cleanup destroys the texture first. The shared cache still contains the same pointer and attempts to destroy it again, causing an invalid access.
## Recommended Fix
**Fix Strategy:** Give the texture a single owner and make the project store a non-owning reference or cache key.
**Minimal Change:** Remove texture destruction from the project object and let the shared image cache remain responsible for resource lifetime.
**Why It Works:** The resource is destroyed exactly once while existing lookup behavior remains unchanged.
## Regression Risk
**Risk:** Low
Check image-cache eviction, project reload, and application shutdown because they also interact with texture lifetime.
## Verification Plan
1. Import an image.
2. Close the project.
3. Reopen and close several projects.
4. Import multiple images and repeat.
5. Exit the application.
6. Run with memory diagnostics and confirm there is no double free or leaked texture.
**Root Cause Confidence:** High
**Fix Confidence:** High
Get this skill + 9 more with Select$14 first month, then $19/mo · Cancel anytime$14 first month · then $19/mo
View SelectBy purchasing this skill, you agree to our terms of service
GPT-5.6
Investigate software bugs systematically, identify the most likely root cause, trace the failure path, and propose the smallest safe code fix. Designed for debugging crashes, incorrect behavior, regressions, state issues, rendering bugs, build failures, and hard-to-reproduce defects across existing codebases.
...more
Added 1 week ago
