Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-394

Ensure all bson_ts are correctly cleaned up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: None
    • Labels:
      None

      Description

      An issue reported on GitHub (linked below) led us to discover a few different places in the driver where we call `bson_new_from_x` (x being data or json), and then pass the result into Document(fromPointer) (which does a bson_copy), but never clean up the result.
      We should ensure that every time we call these methods we clean up their results properly.

      We can either just add bson_destroy s, or a more performant option would be to add a new DocumentStorage initializer that "steals" the bson_t rather than copying its memory.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: