File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -277,15 +277,27 @@ function resolve(name, rrtype=Constants.RR_TYPE_A) {
277
277
function load ( paths ) {
278
278
// if library was already loaded, do a cleanup first before reloading it
279
279
if ( lib ) {
280
- // delete old context
281
- ub_ctx_delete ( ctx ) ;
282
- ctx = ctypes . voidptr_t ( ) ;
283
- // close library
284
- lib . close ( ) ;
280
+ try {
281
+ // delete old context
282
+ ub_ctx_delete ( ctx ) ;
283
+ ctx = ctypes . voidptr_t ( ) ;
284
+ } catch ( error ) {
285
+ log . error ( `Failed to delete old context: ${ error } ; stack: ${ error . stack } ` ) ;
286
+ }
287
+ try {
288
+ // close library
289
+ lib . close ( ) ;
290
+ } catch ( error ) {
291
+ log . error ( `Failed to close old library: ${ error } ; stack: ${ error . stack } ` ) ;
292
+ }
285
293
lib = null ;
286
294
// close dependency of library
287
295
for ( let libDep of libDeps ) {
288
- libDep . close ( ) ;
296
+ try {
297
+ libDep . close ( ) ;
298
+ } catch ( error ) {
299
+ log . error ( `Failed to close old dependency: ${ error } ; stack: ${ error . stack } ` ) ;
300
+ }
289
301
}
290
302
libDeps = [ ] ;
291
303
}
You can’t perform that action at this time.
0 commit comments