Skip to content

Commit 523bf32

Browse files
committed
catch any possible errors from logger in Disjoint Pool
1 parent e83a41b commit 523bf32

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/pool/pool_disjoint.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ std::ostream &operator<<(std::ostream &Os, const Slab &Slab) {
423423
Slab::Slab(Bucket &Bkt)
424424
: // In case bucket size is not a multiple of SlabMinSize, we would have
425425
// some padding at the end of the slab.
426-
Chunks(Bkt.SlabMinSize() / Bkt.getSize()), NumAllocated{0},
427-
bucket(Bkt), SlabListIter{}, FirstFreeChunkIdx{0} {
426+
Chunks(Bkt.SlabMinSize() / Bkt.getSize()), NumAllocated{0}, bucket(Bkt),
427+
SlabListIter{}, FirstFreeChunkIdx{0} {
428428
auto SlabSize = Bkt.SlabAllocSize();
429429
MemPtr = memoryProviderAlloc(Bkt.getMemHandle(), SlabSize);
430430
regSlab(*this);
@@ -446,10 +446,14 @@ Slab::~Slab() {
446446
const char *message = "";
447447
int error = 0;
448448

449-
umfMemoryProviderGetLastNativeError(
450-
umfGetLastFailedMemoryProvider(), &message, &error);
451-
LOG_ERR("Native error msg: %s, native error code: %d", message,
452-
error);
449+
try {
450+
umfMemoryProviderGetLastNativeError(
451+
umfGetLastFailedMemoryProvider(), &message, &error);
452+
LOG_ERR("Native error msg: %s, native error code: %d", message,
453+
error);
454+
} catch (...) {
455+
// ignore any additionall errors from logger
456+
}
453457
}
454458
}
455459
}

0 commit comments

Comments
 (0)