Skip to content

Commit

Permalink
Revert sigint handler
Browse files Browse the repository at this point in the history
  • Loading branch information
icolwell-as committed Nov 22, 2021
1 parent c703770 commit ac04eb2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/avt_vimba_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ AvtVimbaCamera::AvtVimbaCamera(std::string name) {
show_debug_prints_ = false;
name_ = name;

signal(SIGINT, intHandler);

camera_state_ = OPENING;

updater_.setHardwareID("unknown");
Expand Down Expand Up @@ -186,7 +184,6 @@ void AvtVimbaCamera::start(std::string ip_str, std::string guid_str, bool debug_
vimba_camera_ptr_->GetInterfaceType(cam_int_type);
if ( cam_int_type == VmbInterfaceEthernet ){
runCommand("GVSPAdjustPacketSize");

}

std::string trigger_source;
Expand Down Expand Up @@ -314,6 +311,9 @@ CameraPtr AvtVimbaCamera::openCamera(std::string id_str) {
CameraPtr camera;
VimbaSystem& vimba_system(VimbaSystem::GetInstance());

// set handler to catch ctrl+c presses
sighandler_t oldHandler = signal(SIGINT, intHandler);

// get camera
VmbErrorType err = vimba_system.GetCameraByID(id_str.c_str(), camera);
while (err != VmbErrorSuccess) {
Expand Down Expand Up @@ -346,6 +346,9 @@ CameraPtr AvtVimbaCamera::openCamera(std::string id_str) {
}
}

// set previous handler back
signal(SIGINT, oldHandler);

std::string cam_id, cam_name, cam_model, cam_sn, cam_int_id;
VmbInterfaceType cam_int_type;
VmbAccessModeType accessMode; // = VmbAccessModeNone;
Expand Down

0 comments on commit ac04eb2

Please sign in to comment.