The MinGW.org Installation Manager Tool
Revision | d957741a049b565f3928c15405242c30c947ff54 (tree) |
---|---|
Time | 2012-10-18 22:08:05 |
Author | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Fix Diagnostic Message Handler initialisation logic.
@@ -1,3 +1,14 @@ | ||
1 | +2012-10-18 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Fix Diagnostic Message Handler initialisation logic. | |
4 | + | |
5 | + * src/dmh.cpp (dmh_init) [DMH_SUBSYSTEM_GUI]: Correct a logic error; | |
6 | + it previously fell through after any successful initialisation of the | |
7 | + DMH_SUBSYSTEM_GUI handler, replacing it with a DMH_SUBSYSTEM_TTY type | |
8 | + handler. Also, assign a heap copy of the passed "progname" string | |
9 | + resource, which is volatile, to ensure that the handler retains a | |
10 | + valid reference. | |
11 | + | |
1 | 12 | 2012-10-11 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 13 | |
3 | 14 | Implement preliminary GUI mode data sheet compiler. |
@@ -104,16 +104,17 @@ EXTERN_C void dmh_init( const dmh_class subsystem, const char *progname ) | ||
104 | 104 | /* No message handler has yet been initialised; |
105 | 105 | * passing the specified program name, select... |
106 | 106 | */ |
107 | - if( (subsystem == DMH_SUBSYSTEM_GUI) | |
107 | + if( subsystem == DMH_SUBSYSTEM_GUI ) | |
108 | + { | |
108 | 109 | /* |
109 | 110 | * ...a GUI class handler on demand... |
110 | 111 | */ |
111 | - && ((dmh = dmh_init_gui( progname )) == NULL) ) | |
112 | - /* | |
113 | - * ...but bail out, if this cannot be initialised... | |
114 | - */ | |
115 | - throw dmh_exception( "DMH subsystem initialisation failed" ); | |
116 | - | |
112 | + if( (dmh = dmh_init_gui( strdup( progname ))) == NULL ) | |
113 | + /* | |
114 | + * ...but bail out, if this cannot be initialised... | |
115 | + */ | |
116 | + throw dmh_exception( "DMH subsystem initialisation failed" ); | |
117 | + } | |
117 | 118 | else |
118 | 119 | /* ...otherwise, a console class handler by default. |
119 | 120 | */ |