Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
GLib
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 936
    • Issues 936
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 59
    • Merge Requests 59
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • GLib
  • Merge Requests
  • !262

Merged
Opened Aug 22, 2018 by Philip Withnall@pwithnallMaintainer

gmem: Only evaluate pointer argument to g_clear_pointer() once

  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 2

The new typeof() macro version of g_clear_pointer() was evaluating its pointer argument more than once, meaning any side effects would be evaluated multiple times.

The existing (other) macro version of g_clear_pointer() was evaluating its argument exactly once. This mismatch could have confused people or lead to subtle bugs.

See #1494 (closed).

Signed-off-by: Philip Withnall withnall@endlessm.com


Ideally this should go into 2.58 before the new g_clear_pointer() version makes it into a stable release.

Assignee
Assign to
Reviewer
Request review from
2.58
Milestone
2.58 (Past due)
Assign milestone
Time tracking
Reference: GNOME/glib!262
Source branch: g-clear-pointer-no-side-effects

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.