You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should ApplicationCommandLine in on addOnCommandLine be Scoped #142
I'm writing a program using GTKApplication where I need the command line arguments to be passed from the local to primary instance. To do this, I added the flag ApplicationFlags.HANDLES_COMMAND_LINE to my application and implemented attached a handler to addOnCommandLine. It all worked fine except the local instance would just hang and never return.
After doing some investigation and a nudge on IRC from the GTK developers, looking at the documentation for ApplicationCommandLine I see that the local instance will not return unless the ApplicationCommandLine is released. The solution to my issue was pretty easy, just destroy the ApplicationCommandLine when exiting the AddOnCommandLineHandler.
However, I was wondering if the delegate should be changed to make this parameter scoped like was done for the Cairo Context in onDraw?
Activity
gnunn1 commentedon Jan 27, 2016
Here's the exact line in the ApplicationCommandLine I'm referring to:
The lifecycle of the originally-invoked process is tied to the lifecycle of this object (ie: the process exits when the last reference is dropped).MikeWey commentedon Jan 27, 2016
It probably should be.
Add an scoped version of addOnCommandLine. See #142
MikeWey commentedon Jan 30, 2016
I've added a scoped version, the regular one should be deprecated at some point.
gnunn1 commentedon Jan 31, 2016
Thanks Mike!