File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -945,17 +945,19 @@ void
945945Stub::Finalize ()
946946{
947947  finalizing_ = true ;
948-   //  Stop async event loop if created.
949-   if  (!py::isinstance<py::none>(async_event_loop_)) {
950-     async_event_loop_.attr (" stop"  )();
951-   }
952-   //  Call finalize if exists.
953-   if  (initialized_ && py::hasattr (model_instance_, " finalize"  )) {
954-     try  {
955-       model_instance_.attr (" finalize"  )();
948+   if  (initialized_) {
949+     //  Stop async event loop if created.
950+     if  (!py::isinstance<py::none>(async_event_loop_)) {
951+       async_event_loop_.attr (" stop"  )();
956952    }
957-     catch  (const  py::error_already_set& e) {
958-       LOG_INFO << e.what ();
953+     //  Call finalize if exists.
954+     if  (py::hasattr (model_instance_, " finalize"  )) {
955+       try  {
956+         model_instance_.attr (" finalize"  )();
957+       }
958+       catch  (const  py::error_already_set& e) {
959+         LOG_INFO << e.what ();
960+       }
959961    }
960962  }
961963#ifdef  TRITON_ENABLE_GPU
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments