<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 27 mag 2022 alle ore 09:23 Walter Mitty <<a href="mailto:waltermitty121906@gmail.com">waltermitty121906@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi guys,<div>I've been learning spice server source code for a few days. And there is a function named <b>hold_rcc </b>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.</div><div><br></div><div>Best wishes,</div><div>Walter.</div></div></blockquote><div><br></div><div>Hi,</div><div>   there are multiple definitions of that variable, all</div><div><br></div><div>red::shared_ptr<RedChannelClient> hold_rcc(rcc);</div><div><br></div><div>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.</div><div>In some cases it's possible that there are no strong pointers to these objects so we make sure to have one.<br></div><div><br></div><div>Frediano</div><div><br></div></div></div>