Skip to content

Should ApplicationCommandLine in on addOnCommandLine be Scoped #142

Closed

Description

@gnunn1

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

  1. gnunn1 commented on Jan 27, 2016

    @gnunn1
    ContributorAuthor

    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).

  2. self-assigned this
    on Jan 27, 2016
  3. MikeWey commented on Jan 27, 2016

    @MikeWey
    Member

    It probably should be.

  4. MikeWey commented on Jan 30, 2016

    @MikeWey
    Member

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

  5. gnunn1 commented on Jan 31, 2016

    @gnunn1
    ContributorAuthor

    Thanks Mike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions