Skip to content

Commit

Permalink
Real fix for PreModule close file
Browse files Browse the repository at this point in the history
  • Loading branch information
psmit committed Feb 20, 2014
1 parent af2ba7c commit 4c299fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions aku/FeatureModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ PreModule::PreModule() :
m_file_offset(0),
m_cur_pre_frame(INT_MAX),
m_fp(NULL),
m_last_feature_frame(INT_MIN)
m_last_feature_frame(INT_MIN),
m_close_file(false)
{
m_type_str = type_str();
}
Expand Down Expand Up @@ -692,11 +693,10 @@ PreModule::reset_module()
m_last_feature.clear();
m_last_feature_frame = INT_MIN;
m_cur_pre_frame = INT_MAX;
if (m_close_file && m_fp != NULL) {
close(m_fp);
}
if (m_close_file && m_fp != NULL)
fclose(m_fp);
m_fp = NULL;

m_close_file = false;
}

void
Expand Down
3 changes: 1 addition & 2 deletions aku/FeatureModules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ private:
int m_legacy_file; //!< If nonzero, the dimension in the file is a byte
int m_file_offset;
int m_cur_pre_frame;

bool m_close_file = false;
bool m_close_file;

FILE *m_fp;

Expand Down

0 comments on commit 4c299fe

Please sign in to comment.