Skip to content
Snippets Groups Projects
Commit 1c0b83d4 authored by Radovan Červený's avatar Radovan Červený
Browse files

fixed proper deletion of temp files on error

parent cd65bc25
No related branches found
No related tags found
1 merge request!15BP_cervera3 - automatic measurements, processing
...@@ -49,8 +49,10 @@ MPUtils::ShmFileHandle MPUtils::openShmFile ( ) { ...@@ -49,8 +49,10 @@ MPUtils::ShmFileHandle MPUtils::openShmFile ( ) {
   
filename = "/dev/shm" + filename; filename = "/dev/shm" + filename;
   
if ( access ( filename.c_str ( ), F_OK ) == -1 ) if ( access ( filename.c_str ( ), F_OK ) == -1 ) {
shm_unlink ( filename.c_str ( ) );
throw::exception::CommonException ( "MPUtils: can't create shm file in: " + filename ); throw::exception::CommonException ( "MPUtils: can't create shm file in: " + filename );
}
   
return { return {
shmFd, std::move ( filename ) shmFd, std::move ( filename )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment