Re: source code question: how hold_rcc works?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Il giorno ven 27 mag 2022 alle ore 09:23 Walter Mitty <waltermitty121906@xxxxxxxxx> 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,

   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.


[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]