5 Replies Latest reply on Jun 26, 2010 1:07 AM by areohbee

    How to use LrShutdownPlugin

    muhmu

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

        • 1. Re: How to use LrShutdownPlugin
          areohbee Level 5

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

          • 2. Re: How to use LrShutdownPlugin
            muhmu Level 1

            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.

            • 3. Re: How to use LrShutdownPlugin
              areohbee Level 5

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

              • 4. Re: How to use LrShutdownPlugin
                muhmu Level 1

                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.

                • 5. Re: How to use LrShutdownPlugin
                  areohbee Level 5

                  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