I have an application patch (where you can’t directly put anything on dispose operation)
I want to make sure my channels dispose so I use a channel process node.
IF I put the output of the channel process node on Create like so…
Will dispose be called for this channel when the app quits?
If I hover it I don’t see any update running on the tooltip, which I guess makes sense it doesn’t need to do anything on update.
But what about dispose?
(if the process node around it gets disposed, which depends on other factors, like where it is placed, and so on. or the other way around, if the dispose of the app patch can reach it (see it). or if you call it explicitly.)
to check whether you patch has a dispose, just open the code view and have a peek at the generated C#.
However, you don’t use the process node feature for the LiveProject. So that sounds like something you should bother about maybe.
So either call Create and Dispose manually or use the process node LiveProject. It would call Dispose for you when the Application gets stopped.
Note: a ProcessNode doesn’t necessarily need an Update. Having it sitting there just in order to manage the lifetime of the LiveProject is already a nice-to-have. Enable the State Output and feed that into the channel on Create. It looks pretty similar to what you have now, but is a little bit less imperative (no Create call and no need to think of a Dispose call) - it’s more declarative: there is this LiveProject in this Channel.
But if you indeed want to push different “projects” to the “CurrentProjectChannel” and want them to get shut down properly, please stick to what you have and Dipose the old “project” when pushing a new one. The only concern would be that maybe you want to delay the disposal until the next frame?
This reminds me of SerialDisposable which lets you manage a “current” disposable and when you set this property it makes sure that the old one gets disposed of.
It also reminds me of a Cache Region and the Synchronizer Regions. Soo… many many patterns to from - if you feel it’s somehow too dirty to call Dispose yourself from wherever you push a new Project to the channel. And yeah better go with a model-runtime approach where you push a new description of what you want to have and a runtime sync mechanism takes care of syncing to what you want…