Revision: 69127
          http://sourceforge.net/p/brlcad/code/69127
Author:   starseeker
Date:     2016-10-19 01:06:13 +0000 (Wed, 19 Oct 2016)
Log Message:
-----------
Make a few changes, guided by Microsoft's _set_invalid_parameter_handler 
example in their documentation.  This suppresses the assertion successfully.

Modified Paths:
--------------
    brlcad/trunk/src/libbu/temp.c

Modified: brlcad/trunk/src/libbu/temp.c
===================================================================
--- brlcad/trunk/src/libbu/temp.c       2016-10-19 00:50:39 UTC (rev 69126)
+++ brlcad/trunk/src/libbu/temp.c       2016-10-19 01:06:13 UTC (rev 69127)
@@ -30,11 +30,15 @@
 #  include <sys/stat.h>
 #endif
 #include "bio.h"
+#ifdef HAVE_WINDOWS_H
+#  include<crtdbg.h> /* For _CrtSetReportMode */
+#endif
 
 #include "bu/file.h"
 #include "bu/log.h"
 #include "bu/list.h"
 #include "bu/malloc.h"
+#include "bu/time.h"
 #include "bu/vls.h"
 
 #define _TF_FAIL "WARNING: Unable to create a temporary file\n"
@@ -74,7 +78,7 @@
 temp_close_files(void)
 {
 #if defined(HAVE_WINDOWS_H)
-    _invalid_parameter_handler stdhandler;
+    _invalid_parameter_handler stdhandler, nhandler;
 #endif
     struct temp_file_list *popped;
     if (!TF) {
@@ -82,7 +86,10 @@
     }
 
 #if defined(HAVE_WINDOWS_H)
-    stdhandler = _set_invalid_parameter_handler(disable_duplicate_close_check);
+       nhandler = disable_duplicate_close_check;
+    stdhandler = _set_invalid_parameter_handler(nhandler);
+       /* Turn off the message box as well. */
+       (void)_CrtSetReportMode(_CRT_ASSERT, 0);
 #endif 
 
     /* close all files, free their nodes, and unlink */

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to