classA objA (0, NULL);
classA & objB (objA);
假设以上是全局的,它会导致内存泄漏吗?原因?
实际上通过 Valgrind,我得到了一个错误:
5 bytes in 1 blocks are still reachable
...
global constructors keyed to classA
这说明什么?
更新:
确切的错误在这里。
at 0x4C2659D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6653== by 0x4EA7BB7: newterminal (in /usr/lib64/R/lib/libR.so)
==6653== by 0x4EA7D4E: Rf_InitConnections (in /usr/lib64/R/lib/libR.so)
==6653== by 0x4F420DD: setup_Rmainloop (in /usr/lib64/R/lib/libR.so)
==6653== by 0x4FEC76A: Rf_initEmbeddedR (in /usr/lib64/R/lib/libR.so)
==6653== by 0x5C3A8DB: RInside::initialize(int, char const* const*, bool) (in /usr/lib64/R/library/RInside/lib/libRInside.so)
==6653== by 0x5C3AF60: RInside::RInside(int, char const* const*, bool) (in /usr/lib64/R/library/RInside/lib/libRInside.so)
==6653== by 0x40D105: global constructors keyed to R