Skip to main content
June 20, 2010
Pergunta

How to use LrShutdownPlugin

  • June 20, 2010
  • 2 respostas
  • 1149 Visualizações

My plugin spawns a background process, which needs to be shutdown when Lightroom is exited or the plugin is disabled.

SDK manual states that in Info.lua, I can specify a function using LrShutdownPlugin key.  I am a bit confused with this - Info.lua does not allow require/import, so I can't really do anything useful with this?  Ideally, I'd like to be able to make a HTTP request when Lightroom is exiting.

Same goes for LrEnablePlugin/LrDisablePlugin functions, I don't even know how to print a line into log so I don't know if these actually were called or not...

Este tópico foi fechado para respostas.

2 Respostas

June 26, 2010

Today, while working on totally other features of my plugin, I noticed that the shutdown logging message was actually getting outputted when reloading the plugin!  I have currently specified it as a script name in Info.lua

I don't know what caused it, but I am still unable to get it to work on simpler example, such as Hello World plugin in SDK.  Additionally, it is not called when Lightroom exits, only when plugin is reloaded or unloaded, so it is not suitable for shutting down my server process.

I'm trying to get my plugin released next week, so I'm now just adding a idle timeout which will eventually kill the server process.

areohbee
Legend
June 26, 2010

Muhmu,

Thanks for the update. So for the shutdown, you specify a lua file (like for LrInitPlugin), not a function (like it says in the sdk3 guide document) - right?  If so, I think a bug-report against the document is in order.

I'm looking forward to the release of your plugin...

PS - Have you tried my latest (DevAdjust)?

Rob

areohbee
Legend
June 22, 2010

I see your point. Say, I wonder if its a documentation error - did you try specifying a lua filename string instead, like LrInitPlugin?

June 22, 2010

Yes, I tried it, but did not notice anything useful happening, not when I removed the plugin from plugin manager or when I quit Lightroom.  I really wonder what the correct use of it is.

areohbee
Legend
June 22, 2010

I think we need Chet Drarvik to straighten this out (Eric Scouten's replacement).