There are two widgets involved here.  One is the actual displayed widget, 
such as a QWebView.  That's the one checked by vr3.ensure_text_widget(). 
The other one is the ViewRenderedController3 itself, which is not a display 
widget in itself. The latter is the one I was surprised to see is getting 
re-created every time I toggle the VR3 panel off and then on again.  I 
hadn't expected that, although I suppose I should have.

I don't favor creating and dropping resources if not needed, but it doesn't 
happen very often for these VRx panes. So I suppose it's not that bad.  I 
just want to make sure if possible that they are GCed, and not trapped in 
limbo by some unexpected reference.  For instance, it looks like the layout 
that shows the widget has a reference to it (I think).  When that layout is 
asked for again, is it copied with the copy getting a reference to the new 
widget, or is its reference simply replaced by the new?  If the former, we 
might have a leak if the old layout still hangs around somewhere.

On Saturday, October 3, 2020 at 8:07:38 AM UTC-4 Edward K. Ream wrote:

> On Fri, Oct 2, 2020 at 11:57 AM [email protected] <[email protected]> 
> wrote:
>
> By adding print statements to the constructors, I see that only one VR3 
>> plugin instance is getting created per outline.  I also see that a new VR3 
>> controller widget (ViewRenderedController3) is getting created every 
>> time the vr3-show command is run.
>>
>
> That's not how I read the code.  See vr3.getVr3. It's 
> vr3.ensure_text_widget that allocates the widget. 
>  
>
>> So the question is, what happens to the previous instance?  Leaked or 
>> GCed?
>>
>
> Imo you are overly worried about the gc. Unless VR3 is creating *separate* 
> links to allocated widgets, it hardly matters how many widgets get 
> allocated. Only widgets with references will stick around. The gc will 
> handle the rest.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/61171931-83ad-40de-b05b-955177d56891n%40googlegroups.com.

Reply via email to