In Windows, what happens to an open HKEY variable if you don't call RegCloseKey before the HKEY goes out of scope? I don't see any errors or warnings, nor any memory leaks when the application closes. MSDN doesn't offer much help, but makes it sound like it somehow uses up resources. Does anyone know what actually happens?
You orphan a handle, which are a limited (OK, it's a pretty large limit) resource. However, once your app terminates the handle is eventually released by the OS, so the wasted resource is eventually returned to the pool.
It's bad programming practice, though, to allocate something that has limits and not release it when you're done using it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With