• arendjrOP
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    3 hours ago

    Using smart pointers doesn’t eliminate the memory safety issue, it merely addresses one aspect of it. Even with smart pointers, nothing is preventing you from passing references and using them after they’re freed.

    • refalo
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      3 hours ago

      To be fair, it’s entirely possible to make the same and very similar mistakes in Rust, too.