Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2465

TBinaryProtocolT breaks if copied/moved

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.9
    • 0.9.3
    • C++ - Library
    • None

    Description

      by virtue of omitting the copy constructor, TBinaryProtocolT gets a default one generated for it which is incorrect since it's potentially managing memory (namely the string_buf_ pointer).

      TBinaryProtocolT should delete/make private the copy constructor & copy assignment operator.

      Under C+11, string_buf_ could be changed to a unique_ptr which would let you use the default move constructor/move assignment operator. Alternatively under C+11, a move constructor/assignment operator needs to be defined.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hcorg Konrad Grochowski
            vlovich Vitali Lovich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment