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

GUI2: made widget initialization process more secure against memory leaks #6681

Merged
merged 7 commits into from
May 6, 2022

Commits on May 4, 2022

  1. GUI2: made widget initialization process more secure against memory l…

    …eaks
    
    This commit is the followup to a similar one I did regarding window initialization. Instead
    of widgets being created on the heap and not being managed by a smart pointer until they're
    added to a grid, they are now always managed by a shared_ptr. To that end, this commit covers
    bunch of things:
    
    * builder_widget::build (both overloads) and all its overrides (which have now been marked
      as such) now return shared_ptr<widget>.
    * The builder_grid::build() override now returns the same instead of grid* since you can't
      use covariant return types with smart pointers.
    * The two implementation build helpers in builder_grid have been combined with an optional
      replacement map as the second parameter. Uses of the version that took a grid pointer could
      be easily converted to pass a reference instead.
    * The pane, matrix, and viewport build() functions were removed in favor of making the ctor
      public. In case there was a deprecated ctor, that was removed.
    * The viewport now keeps a widget shared_ptr instead of a reference that was then deleted
      by address-of. This was both better design and necessary to fix a crash.
    Vultraz committed May 4, 2022
    Configuration menu
    Copy the full SHA
    7a1c9ff View commit details
    Browse the repository at this point in the history

Commits on May 5, 2022

  1. Configuration menu
    Copy the full SHA
    8037361 View commit details
    Browse the repository at this point in the history
  2. Tests fix to attempt

    Vultraz committed May 5, 2022
    Configuration menu
    Copy the full SHA
    e989a0f View commit details
    Browse the repository at this point in the history
  3. Fix fix fix

    Vultraz committed May 5, 2022
    Configuration menu
    Copy the full SHA
    b49a509 View commit details
    Browse the repository at this point in the history
  4. feeeeeeeeex

    Vultraz committed May 5, 2022
    Configuration menu
    Copy the full SHA
    5e783ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cfdb9db View commit details
    Browse the repository at this point in the history
  6. fixupfixupfixup

    Vultraz committed May 5, 2022
    Configuration menu
    Copy the full SHA
    46fc1bd View commit details
    Browse the repository at this point in the history