Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix basic_config() #38

Open
tclune opened this issue Aug 13, 2020 · 0 comments
Open

Fix basic_config() #38

tclune opened this issue Aug 13, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tclune
Copy link
Member

tclune commented Aug 13, 2020

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 tclune added the bug Something isn't working label Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants