Register an attachment specific cleanup handler.
| 2013 | |
| 2014 | // Register an attachment specific cleanup handler. |
| 2015 | ISC_STATUS API_ROUTINE isc_database_cleanup(ISC_STATUS* userStatus, isc_db_handle* handle, |
| 2016 | AttachmentCleanupRoutine* routine, void* arg) |
| 2017 | { |
| 2018 | StatusVector status(userStatus); |
| 2019 | CheckStatusWrapper statusWrapper(&status); |
| 2020 | |
| 2021 | try |
| 2022 | { |
| 2023 | RefPtr<YAttachment> attachment(translateHandle(attachments, handle)); |
| 2024 | |
| 2025 | AutoPtr<CleanupCallbackImpl<YAttachment, AttachmentCleanupRoutine> > callback( |
| 2026 | FB_NEW CleanupCallbackImpl<YAttachment, AttachmentCleanupRoutine>(attachment, routine, arg)); |
| 2027 | |
| 2028 | attachment->addCleanupHandler(&statusWrapper, callback); |
| 2029 | |
| 2030 | if (!(status.getState() & IStatus::STATE_ERRORS)) |
| 2031 | callback.release(); |
| 2032 | } |
| 2033 | catch (const Exception& e) |
| 2034 | { |
| 2035 | e.stuffException(&statusWrapper); |
| 2036 | } |
| 2037 | |
| 2038 | return status[1]; |
| 2039 | } |
| 2040 | |
| 2041 | |
| 2042 | // Provide information on database object. |
nothing calls this directly
no test coverage detected