Il giorno ven 27 mag 2022 alle ore 09:23 Walter Mitty < waltermitty121...@gmail.com> ha scritto:
> Hi guys, > I've been learning spice server source code for a few days. And there is a > function named *hold_rcc *that makes me confused. I can't find its > definition. I guess it is not a regular declaration. It may be generated > from a template. I wanna figure out how it is declared and what it does? > Could anyone give me some advice? Thanks in advance. > > Best wishes, > Walter. > Hi, there are multiple definitions of that variable, all red::shared_ptr<RedChannelClient> hold_rcc(rcc); that's just a construction of a shared pointer "holding" rcc. It makes sure the object is not released till the scope of hold_rcc. In some cases it's possible that there are no strong pointers to these objects so we make sure to have one. Frediano