* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL handle.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2006-08-10  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
|  | 	* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL | ||||||
|  | 	handle. | ||||||
|  |  | ||||||
| 2006-08-10  Christopher Faylor  <cgf@timesys.com> | 2006-08-10  Christopher Faylor  <cgf@timesys.com> | ||||||
|  |  | ||||||
| 	* winsup.h: Turn on DEBUGGING by default for now. | 	* winsup.h: Turn on DEBUGGING by default for now. | ||||||
|   | |||||||
| @@ -240,7 +240,7 @@ close_handle (const char *func, int ln, HANDLE h, const char *name, bool force) | |||||||
|  |  | ||||||
| #if 1 /* Uncomment to see CloseHandle failures */ | #if 1 /* Uncomment to see CloseHandle failures */ | ||||||
|   if (!ret) |   if (!ret) | ||||||
|     small_printf ("CloseHandle(%s) failed %s:%d\n", name, func, ln); |     small_printf ("CloseHandle(%s) %p failed %s:%d, %E\n", name, h, func, ln); | ||||||
| #endif | #endif | ||||||
|   return ret; |   return ret; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1097,10 +1097,11 @@ class _onreturn | |||||||
| public: | public: | ||||||
|   ~_onreturn () |   ~_onreturn () | ||||||
|   { |   { | ||||||
|     if (h) |     if (h && *h) | ||||||
|       { |       { | ||||||
| 	CloseHandle (*h); | 	CloseHandle (*h); | ||||||
| 	*h = NULL; | 	*h = NULL; | ||||||
|  | 	h = NULL; | ||||||
|       } |       } | ||||||
|   } |   } | ||||||
|   void no_close_p_handle () {h = NULL;} |   void no_close_p_handle () {h = NULL;} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user