mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-08 17:19:45 +00:00
fix: comments 2
This commit is contained in:
parent
02949e961a
commit
be8f5a6db2
@ -69,13 +69,18 @@ impl IndexerServiceFFI {
|
||||
// Implement Drop to prevent memory leaks
|
||||
impl Drop for IndexerServiceFFI {
|
||||
fn drop(&mut self) {
|
||||
if self.indexer_handle.is_null() {
|
||||
let Self {
|
||||
indexer_handle,
|
||||
runtime,
|
||||
} = self;
|
||||
|
||||
if indexer_handle.is_null() {
|
||||
log::error!("Attempted to drop a null indexer pointer. This is a bug");
|
||||
}
|
||||
if self.runtime.is_null() {
|
||||
if runtime.is_null() {
|
||||
log::error!("Attempted to drop a null tokio runtime pointer. This is a bug");
|
||||
}
|
||||
drop(unsafe { Box::from_raw(self.indexer_handle.cast::<IndexerHandle>()) });
|
||||
drop(unsafe { Box::from_raw(self.runtime.cast::<Runtime>()) });
|
||||
drop(unsafe { Box::from_raw(indexer_handle.cast::<IndexerHandle>()) });
|
||||
drop(unsafe { Box::from_raw(runtime.cast::<Runtime>()) });
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user