summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlestes <wlestes>2007-04-25 18:16:34 +0000
committerwlestes <wlestes>2007-04-25 18:16:34 +0000
commit23de2edd3185afd9041e967c721408df36c4b154 (patch)
treee00219cc20aef41402b9ef54b9bccb04df6e0bdf
parent14f171a31d9d7237918c14f6451f7fb46c1c76a4 (diff)
downloadflex-23de2edd3185afd9041e967c721408df36c4b154.tar.gz
c++ memory leak plug
-rw-r--r--flex.skl22
1 files changed, 9 insertions, 13 deletions
diff --git a/flex.skl b/flex.skl
index 75c2e6b..0a2f151 100644
--- a/flex.skl
+++ b/flex.skl
@@ -1488,6 +1488,14 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
]])
}
+yyFlexLexer::~yyFlexLexer()
+{
+ delete [] yy_state_buf;
+ yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );
+ yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
+ yyfree( yy_buffer_stack M4_YY_CALL_LAST_ARG );
+}
+
void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
{
if ( new_in )
@@ -2807,14 +2815,9 @@ m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
%endif
-%if-c-or-c++
-%if-c-only
+%if-c-only SNIP! this currently causes conflicts with the c++ scanner
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy YYFARGS0(void)
-%endif
-%if-c++-only
-yyFlexLexer::~yyFlexLexer()
-%endif
{
M4_YY_DECL_GUTS_VAR();
@@ -2829,12 +2832,6 @@ yyFlexLexer::~yyFlexLexer()
yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);
YY_G(yy_buffer_stack) = NULL;
-%if-c++-only
- delete [] YY_G(yy_state_buf);
- yyfree(YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
-%endif
-
-%if-c-only
m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
[[
/* Destroy the start condition stack. */
@@ -2858,7 +2855,6 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
yyscanner = NULL;
%endif
return 0;
-%endif
}
%endif