pFlogger icon indicating copy to clipboard operation
pFlogger copied to clipboard

Fix basic_config()

Open tclune opened this issue 3 years ago • 0 comments

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

tclune avatar Aug 13 '20 16:08 tclune