Using Lua 5.4’s __close Metamethod for Deterministic Cleanup
Shows how the <close> attribute invokes __close automatically when a variable leaves scope, ensuring resources like files are released even on error.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Shows how the <close> attribute invokes __close automatically when a variable leaves scope, ensuring resources like files are released even on error.
Raw delete calls are one exception away from a leak. Here's how to choose between unique_ptr, shared_ptr, and weak_ptr — with working code, the cycle trap, and a sanitizer check.
Delphi 10.4+ Custom Managed Records provide RAII for value types via Initialize, Finalize, and Assign operators. Learn how to implement deterministic cleanup without heap allocation or interface overhead.