Re: [Fresco-devel] RefCount_var<Fresco::Graphic> or Graphic_var?

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
Hey Kent,

[email protected] wrote:
> Hey all,
> 
> I'm new to Fresco, and was looking into fixing the "swap checkbox and radiobox looks" 
> bug (http://issues.fresco.org/bug151).  I was able to fix this, but was a little curious
> as to the difference between RefCount_var<Fresco::Graphic> and Graphic_var.  In particular,
> I noticed that in Berlin/modules/Widgets/Motif/Choice.cc on line 75 (under ToggleChoice) 
> the frame variable is declared as Graphic_var, but on line 137 (under CheckboxChoice) frame
> is declared as RefCount_var<Fresco::Graphic>.  As far as I could tell, these compiled and 
> ran interchangably.  I assume that one of these was the "old way" to do things and one is 
> the "new way."  Since I couldn't which was which, and I didn't want to submit a patch leaving
> this inconsistancy, I figured I'd ask.  Thanks in advance for any help.

nice you brought that up...;-)

You may find the tutorial useful: http://www2.fresco.org/tutorial,
in particular appendix B 'memory management'. The problem we face is
reference counting in a distributed environment. In a nutshell, you'v
got to care for different types of objects: proxies, servants, and
'CORBA objects'. All those _var types are smart pointer helper classes
that help to deal with that, i.e. make it convenient, and more
importantly, exception safe.


Graphic_var operates on proxies. RefCount_var<Fresco::Graphic> operates
on CORBA objects ('Graphic', in this case).

The east / straight forward fix is to use RefCount_var<Fresco::Graphic>
everywhere, but on the other hand that may be unnecessary in some cases,
and as it involves two additional CORBA method calls, I was reluctant to
just throw it in everywhere.

But you are quite right, the current state is highly confusing and
buggy, so we have to work out how to proceed.


Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.