Skip to main content
Known Participant
December 19, 2016

P: LrShutDownApp called late in process--socket already closed

  • December 19, 2016
  • 3 replies
  • 315 views

My plugin collaborates with an  application through LrSocket. Unfortunately, when LR shuts down, it only calls LrShutDownApp after the socket no longer functions. I've tested this by sending a message to the application by LrShutdownApp and LrShutdownPlugin. The message gets sent when LrShutdownPlugin is called, but not when LrShutdownApp is. This creates significant problems for any plugin that has an associated application, as you can't get an orderly shutdown of both.

Fix--call LrShutDownApp procedures earlier in the shutdown process, prior to killing the sockets.

3 replies

Adobe Employee
January 23, 2020
When shutting down Lightroom, plugins are unloaded first - and you should be able to close your sockets then. Do you have a sample plugin that demonstrates this problem clearly? That will help us identify any assumptions in the SDK about expected plugin workflows.

Thanks for your patience and cooperation.
rsjaffeeAuthor
Known Participant
January 18, 2017
I'm trying to get the app to unload. Waiting until after the pipes are closed makes it more difficult to communicate, makes it impossible to close gracefully, and causes some app stability problems on Mac OS.
Chet Drarvik
Adobe Employee
Adobe Employee
December 19, 2016
This does sound like a problem in Lightroom.

Is your specific problem that you would like to notify the companion application via the socket when Lightroom is shutting down? If so, maybe you can work around the problem by detecting in the companion app when the socket connection is terminated unexpectedly?

Or maybe he optional 'onClosed' (LrSocket.bind parameter) can be of use to work around the problem?