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

  • 2
  • Problem
  • Updated 1 year ago
  • (Edited)
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.
Photo of Rory Jaffe

Rory Jaffe

  • 37 Posts
  • 5 Reply Likes

Posted 2 years ago

  • 2
Photo of Kjetil Drarvik

Kjetil Drarvik, Employee

  • 6 Posts
  • 2 Reply Likes
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?
Photo of Rory Jaffe

Rory Jaffe

  • 37 Posts
  • 5 Reply Likes
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.