Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Manually implement FFI code for GObject instead of using glib_shared_wrapper! #547

Merged
merged 3 commits into from Dec 7, 2019
Merged

Manually implement FFI code for GObject instead of using glib_shared_wrapper! #547

merged 3 commits into from Dec 7, 2019

Commits on Dec 7, 2019

  1. Manually implement FFI code for GObject instead of using glib_shared_…

    …wrapper!
    
    This way we can implement special cases more correctly:
    - g_value_get_boxed() is invalid for GObjects
    - Debug impl can print the actual type
    - Only from_glib_none() will ever steal floating references and e.g.
      cloning does not, see #545
    
    After this the only places where we would steal floating references from
    C code would be when explicitly calling from_glib_none() somewhere. That
    is, when we call a function and get a (transfer none) reference to an
    object back. (transfer floating) is an alias for this.
    
    Especially, cloning and from_glib_borrow() would never steal floating
    references, and because of this it is very important to only ever use
    from_glib_borrow() inside callbacks, signal handlers and virtual method
    trampolines.
    sdroege committed Dec 7, 2019
    Copy the full SHA
    3c96e5d View commit details
    Browse the repository at this point in the history
  2. Make FloatingReferenceGuard a no-op

    Once all crates are updated this struct should be completely removed.
    sdroege committed Dec 7, 2019
    Copy the full SHA
    a693a5d View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    2dab0e8 View commit details
    Browse the repository at this point in the history