visual c++ - CloseHandle():Return value check require -


I am using CloseHandle () to close the handle for the thread. This is done at the end of the program and therefore close handle ();

Cleanliness should be done regardless of price;

The PC-lint reports the error, which ignores the value in return for work.

Please let me know that if the return value is ignored then there will be a problem

Easy answer: I do not think I have ever seen any code where anywhere the return value of the close handle is being examined, nor the close hand no never work anybody Also, the reason for the bug I've ever seen in 15+ years of programming (YMMV) on Windows.

Actual answer: Of course you should check the error return (all the ways that the failure can return, all the time), assuming that the continuous error handling structure in your application is already in place Just working with that will constantly check the values ​​and failure to accept success, big, often difficult to understand, there is a recipe for failure in code.

He said: Will I worry about CloseHandle unsuccessful application shutdown? Maybe not But only my 2 cents are required.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -