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

Add safety checks #189

Merged
merged 5 commits into from
Nov 18, 2015
Merged

Add safety checks #189

merged 5 commits into from
Nov 18, 2015

Conversation

gkoz
Copy link
Member

@gkoz gkoz commented Nov 17, 2015

  • Assert that GTK is initialized in constructors and free functions.
  • Prevent unwinding across FFI.
  • Make main_quit safe.

Fix #187 and #188

@GuillaumeGomez
Copy link
Member

And here comes the monstruous thing... I forgot to ask : does your script takes in account the fact the macro is already called or does it just add it without checking ?

@gkoz
Copy link
Member Author

gkoz commented Nov 17, 2015

The script is a fancy specialized version of grep. It will fail the test if a non-method is missing the assert. Macro invocations were added semi-automatically by a variation of that regex.

@gkoz
Copy link
Member Author

gkoz commented Nov 17, 2015

This is the script, that helps me do these kinds of sweeping 'refactorings'. A long time ago when starting to tinker with rgtk I was intending to make a graphical tool in Rust for this but this script does the job mostly.

@GuillaumeGomez
Copy link
Member

We should think about adding a repo for all these scripts, don't you think ?

@gkoz
Copy link
Member Author

gkoz commented Nov 17, 2015

Dunno. The replacer script is pretty generic and spartan. Anything else?

@GuillaumeGomez
Copy link
Member

The rustdoc-stripper when the regenerate part will be done ? Once again, it's just an idea.

@gkoz
Copy link
Member Author

gkoz commented Nov 17, 2015

Yeah perhaps.
Oops, I've just tried running the examples for the first time and looks like I'll be fixing up the PRs 😨

@gkoz gkoz changed the title Assert that GTK is initialized in constructors and free functions Add safety checks Nov 18, 2015
@gkoz
Copy link
Member Author

gkoz commented Nov 18, 2015

Added callback guard. This completes the safety fixes I had in mind for now.

GuillaumeGomez added a commit that referenced this pull request Nov 18, 2015
@GuillaumeGomez GuillaumeGomez merged commit b400a92 into gtk-rs:master Nov 18, 2015
EPashkin pushed a commit to EPashkin/gtk that referenced this pull request Apr 18, 2016
alex179ohm pushed a commit to alex179ohm/gtk that referenced this pull request Oct 21, 2019
Remove unneeded generated end extra line and add extra empty lines between trait function declarations
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants