mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 23:07:13 +02:00
made it work for gotthard
This commit is contained in:
@ -27,7 +27,7 @@ Fifo::Fifo(uint32_t fifoItemSize, uint32_t fifoDepth, bool &success):
|
||||
|
||||
Fifo::~Fifo() {
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
cprintf(RED,"destroying fifos\n");
|
||||
cprintf(BLUE,"Fifo Object %d: Goodbye\n", index);
|
||||
DestroyFifos();
|
||||
NumberofFifoClassObjects--;
|
||||
}
|
||||
@ -47,6 +47,7 @@ int Fifo::CreateFifos(uint32_t fifoItemSize, uint32_t fifoDepth) {
|
||||
memory = (char*) calloc (fifoItemSize * fifoDepth, sizeof(char));
|
||||
if (memory == NULL){
|
||||
FILE_LOG (logERROR) << "Could not allocate memory for fifos";
|
||||
memory = 0;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@ -69,6 +70,11 @@ int Fifo::CreateFifos(uint32_t fifoItemSize, uint32_t fifoDepth) {
|
||||
void Fifo::DestroyFifos(){
|
||||
FILE_LOG (logDEBUG) << __AT__ << " called";
|
||||
|
||||
|
||||
if(memory) {
|
||||
free(memory);
|
||||
memory = 0;
|
||||
}
|
||||
if (fifoBound) {
|
||||
delete fifoBound;
|
||||
fifoBound = 0;
|
||||
@ -81,10 +87,6 @@ void Fifo::DestroyFifos(){
|
||||
delete fifoStream;
|
||||
fifoStream = 0;
|
||||
}
|
||||
if(memory) {
|
||||
free(memory);
|
||||
memory = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user