Goddard-Fortran-Ecosystem / pFlogger

A parallel Fortran logger (based on the design of the Python logger)
Other
18 stars 8 forks source link

Fix basic_config() #38

Open tclune opened 4 years ago

tclune commented 4 years ago

The recent fix for sharing handlers and locks among Logger objects broke basic_config(). A copy must be made somewhere of each handler passed in to avoid dangling pointers and or memory leaks.

A fix might look something like:

      handler_map => this%elements%get_handlers()

      i = 1
      if (present(handlers)) then
         iter = handlers%begin()
         do while (iter /= handlers%end())
            h => iter%get()
            write(name,'"handler_",(i3.3)') i
            call handler_map%insert(name, h)
            h => handler_map%at(name)
            call this%root_node%add_handler(h)
            i = i + 1
            call iter%next
         end do
      end if