@@ -292,6 +292,18 @@ int mca_pml_ob1_component_fini(void)
292292 return OMPI_SUCCESS ; /* never selected.. return success.. */
293293 mca_pml_ob1 .enabled = false; /* not anymore */
294294
295+ /* return the static receive/send requests to the respective free list and
296+ * let the free list handle destruction. */
297+ if ( NULL != mca_pml_ob1_recvreq ) {
298+ opal_free_list_return (& mca_pml_base_recv_requests , (opal_free_list_item_t * ) mca_pml_ob1_recvreq );
299+ mca_pml_ob1_recvreq = NULL ;
300+ }
301+
302+ if ( NULL != mca_pml_ob1_sendreq ) {
303+ opal_free_list_return (& mca_pml_base_send_requests , (opal_free_list_item_t * ) mca_pml_ob1_sendreq );
304+ mca_pml_ob1_sendreq = NULL ;
305+ }
306+
295307 OBJ_DESTRUCT (& mca_pml_ob1 .rdma_pending );
296308 OBJ_DESTRUCT (& mca_pml_ob1 .pckt_pending );
297309 OBJ_DESTRUCT (& mca_pml_ob1 .recv_pending );
@@ -304,15 +316,6 @@ int mca_pml_ob1_component_fini(void)
304316 OBJ_DESTRUCT (& mca_pml_ob1 .lock );
305317 OBJ_DESTRUCT (& mca_pml_ob1 .send_ranges );
306318
307- if ( NULL != mca_pml_ob1_recvreq ) {
308- OBJ_DESTRUCT (mca_pml_ob1_recvreq );
309- mca_pml_ob1_recvreq = NULL ;
310- }
311- if ( NULL != mca_pml_ob1_sendreq ) {
312- OBJ_DESTRUCT (mca_pml_ob1_sendreq );
313- mca_pml_ob1_sendreq = NULL ;
314- }
315-
316319 if ( NULL != mca_pml_ob1 .allocator ) {
317320 (void )mca_pml_ob1 .allocator -> alc_finalize (mca_pml_ob1 .allocator );
318321 mca_pml_ob1 .allocator = NULL ;
0 commit comments