Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1615

c++: container leaks if exception thrown by handler.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • cpp-binding

    Description

      An exception throw by a handler is re-thrown out of container.run() as expected, however
      the container does not shut down cleanly and many leaks are reported by valgrind or asan. The container should be exception-safe.

      To demonstrate the problem apply this small patch to the helloworld_direct example.

      examples/cpp/helloworld_direct.cpp | 1 +

      modified examples/cpp/helloworld_direct.cpp
      @@ -53,6 +53,7 @@ class hello_world_direct : public proton::messaging_handler {

      // Receive one message and stop listener
      void on_message(proton::delivery &, proton::message &m) OVERRIDE

      { + throw std::runtime_error("thrown from on_message"); std::cout << m.body() << std::endl; listener.stop(); }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aconway Alan Conway
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: