+2012-10-18 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Fix Diagnostic Message Handler initialisation logic.
+
+ * src/dmh.cpp (dmh_init) [DMH_SUBSYSTEM_GUI]: Correct a logic error;
+ it previously fell through after any successful initialisation of the
+ DMH_SUBSYSTEM_GUI handler, replacing it with a DMH_SUBSYSTEM_TTY type
+ handler. Also, assign a heap copy of the passed "progname" string
+ resource, which is volatile, to ensure that the handler retains a
+ valid reference.
+
2012-10-11 Keith Marshall <keithmarshall@users.sourceforge.net>
Implement preliminary GUI mode data sheet compiler.
/* No message handler has yet been initialised;
* passing the specified program name, select...
*/
- if( (subsystem == DMH_SUBSYSTEM_GUI)
+ if( subsystem == DMH_SUBSYSTEM_GUI )
+ {
/*
* ...a GUI class handler on demand...
*/
- && ((dmh = dmh_init_gui( progname )) == NULL) )
- /*
- * ...but bail out, if this cannot be initialised...
- */
- throw dmh_exception( "DMH subsystem initialisation failed" );
-
+ if( (dmh = dmh_init_gui( strdup( progname ))) == NULL )
+ /*
+ * ...but bail out, if this cannot be initialised...
+ */
+ throw dmh_exception( "DMH subsystem initialisation failed" );
+ }
else
/* ...otherwise, a console class handler by default.
*/