mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-07 13:10:42 +02:00
remove leaks
This commit is contained in:
parent
315bf6eb5d
commit
2bc6e16887
@ -21,4 +21,7 @@ class Frame {
|
|||||||
public:
|
public:
|
||||||
Frame(std::byte* fp, ssize_t rows, ssize_t cols);
|
Frame(std::byte* fp, ssize_t rows, ssize_t cols);
|
||||||
DataType get(int row, int col);
|
DataType get(int row, int col);
|
||||||
|
~Frame(){
|
||||||
|
delete[] data;
|
||||||
|
}
|
||||||
};
|
};
|
@ -0,0 +1,7 @@
|
|||||||
|
#include "File.hpp"
|
||||||
|
|
||||||
|
File::~File() {
|
||||||
|
for (auto& subfile : subfiles) {
|
||||||
|
delete subfile;
|
||||||
|
}
|
||||||
|
}
|
@ -51,7 +51,7 @@ class File {
|
|||||||
|
|
||||||
config cfg{0,0};
|
config cfg{0,0};
|
||||||
// File();
|
// File();
|
||||||
// ~File();
|
~File();
|
||||||
|
|
||||||
inline size_t bytes_per_frame() const { return rows * cols * bitdepth / 8; }
|
inline size_t bytes_per_frame() const { return rows * cols * bitdepth / 8; }
|
||||||
inline size_t pixels() const { return rows * cols; }
|
inline size_t pixels() const { return rows * cols; }
|
||||||
|
@ -10,7 +10,11 @@ Frame<uint16_t> JsonFile::get_frame(int frame_number){
|
|||||||
subfiles[subfile_id]->get_frame(buffer, frame_number%max_frames_per_file);
|
subfiles[subfile_id]->get_frame(buffer, frame_number%max_frames_per_file);
|
||||||
|
|
||||||
|
|
||||||
return Frame<uint16_t>(buffer, rows, cols);
|
|
||||||
|
auto f = Frame<uint16_t>(buffer, rows, cols);
|
||||||
|
|
||||||
|
delete[] buffer;
|
||||||
|
return f;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,4 +33,5 @@ int main() {
|
|||||||
|
|
||||||
|
|
||||||
delete fileFactory;
|
delete fileFactory;
|
||||||
|
delete f;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user