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

Should ApplicationCommandLine in on addOnCommandLine be Scoped #142

Closed
gnunn1 opened this issue Jan 27, 2016 · 4 comments
Closed

Should ApplicationCommandLine in on addOnCommandLine be Scoped #142

gnunn1 opened this issue Jan 27, 2016 · 4 comments
Assignees

Comments

@gnunn1
Copy link
Contributor

@gnunn1 gnunn1 commented Jan 27, 2016

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?

@gnunn1
Copy link
Contributor Author

@gnunn1 gnunn1 commented 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 MikeWey self-assigned this Jan 27, 2016
@MikeWey
Copy link
Member

@MikeWey MikeWey commented Jan 27, 2016

It probably should be.

MikeWey added a commit that referenced this issue Jan 30, 2016
The regular version should be deprecated at some point.
@MikeWey
Copy link
Member

@MikeWey MikeWey commented Jan 30, 2016

I've added a scoped version, the regular one should be deprecated at some point.

@MikeWey MikeWey closed this Jan 30, 2016
@gnunn1
Copy link
Contributor Author

@gnunn1 gnunn1 commented Jan 31, 2016

Thanks Mike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants