Mercurial > hg > svcore
comparison data/fileio/MatrixFile.cpp @ 546:95391b480e17
* Make use of peak cache in spectrogram
author | Chris Cannam |
---|---|
date | Wed, 04 Feb 2009 15:03:42 +0000 |
parents | 3cc4b7cd2aa5 |
children | 806e3c72b5df |
comparison
equal
deleted
inserted
replaced
545:c603d9439b37 | 546:95391b480e17 |
---|---|
154 { | 154 { |
155 if (m_fd >= 0) { | 155 if (m_fd >= 0) { |
156 if (::close(m_fd) < 0) { | 156 if (::close(m_fd) < 0) { |
157 ::perror("MatrixFile::~MatrixFile: close failed"); | 157 ::perror("MatrixFile::~MatrixFile: close failed"); |
158 } | 158 } |
159 openCount --; | |
159 } | 160 } |
160 | 161 |
161 QMutexLocker locker(&m_createMutex); | 162 QMutexLocker locker(&m_createMutex); |
162 | 163 |
163 if (m_fileName != "") { | 164 if (m_fileName != "") { |
174 | 175 |
175 if (m_mode == WriteOnly) { | 176 if (m_mode == WriteOnly) { |
176 totalStorage -= (m_headerSize + (m_width * m_height * m_cellSize) + m_width); | 177 totalStorage -= (m_headerSize + (m_width * m_height * m_cellSize) + m_width); |
177 } | 178 } |
178 totalCount --; | 179 totalCount --; |
179 openCount --; | |
180 | 180 |
181 #ifdef DEBUG_MATRIX_FILE | 181 #ifdef DEBUG_MATRIX_FILE |
182 std::cerr << "MatrixFile[" << m_fd << "]::~MatrixFile: " << std::endl; | 182 std::cerr << "MatrixFile[" << m_fd << "]::~MatrixFile: " << std::endl; |
183 std::cerr << "MatrixFile: Total storage now " << totalStorage/1024 << "K in " << totalCount << " instances (" << openCount << " open)" << std::endl; | 183 std::cerr << "MatrixFile: Total storage now " << totalStorage/1024 << "K in " << totalCount << " instances (" << openCount << " open)" << std::endl; |
184 #endif | 184 #endif |