m12-lifecycle
Installation
SKILL.md
C++ Resource Lifecycle
Core Question
When does this die?
- Stack: End of scope
}. - Heap: When
delete(or smart pointer drop) occurs. - Static: At program exit (reverse init order).
Error → Design Question
| Issue | Design Question |
|---|---|
| Resource Leak | Did you manually open() without a wrapper class? |
| Use After Free | Did you capture a reference to a local variable in a lambda/thread? |
| Static Fiasco | Do statics depend on each other? (Use Meyers Singleton). |