Graphics

 View Only
  • 1.  Xpression Script Live COM Objects

    Posted 06-09-2020 13:32

    Hello

    I have an Issue/Bug using scripts in XPression scenes. The scripts were working 7 out of 8 times running the scene.
    After research, I found that in the Resource Monitor ther is a line called "Live COM Objects".
    Every time a script is executed, the number of "Live COM Objects" increases. If the number reaches 200, it is reset to 0. That's the point where the script fails.
    I think the COM objects are being flushed while the script is executing. So it looses the references to the objects.

    Any ideas how to solve this?

    Best Regards,
    Remo



  • 2.  RE: Xpression Script Live COM Objects

    Posted 06-15-2020 17:34

    The COM objects are only referenced for the period while the script is running; there is no way to hold a reference outside of an active script.  You are correct that the garbage collector runs every 200 objects to cleanup the objects from previously executed scripts. This behavior is by design and intended.

    A common issue caused by not understanding this is trying to use GetSceneByName and getting a scene copy and putting that on-air.  The scene will lose its reference and get cleaned up by the garbage collector and get taken off.  The correct solution to this is to not put scene copies on-air from a script, but rather to get the original scene by passing False as the third parameter to GetSceneByName, or instead by putting a sequencer item on-air instead.  

     


    #XPression