K
Krishs
Hi all,
well this is pretty much confusion to me as well, but here is
scenario. I have two shared objects file and one loader executable.
loader calls extern function in shared1 , which has one class ,
initialize it and run its method , which would call extern in shared2.
after shared2 extern function returns, the "this" pointer get 0x00 in
A::Run(),
any guess what would have been happened, I have using gcc version 4+
to build the project.
** loader.cpp
- calls run_test(); in shared1.cpp
** shared1.cpp
class A {
public:
Run() { mum_tum(); doWell(); }
doWell() { }
};
extern void run_test() {
A *a = new A();
a->Run();
}
** shared2.cpp
extern void mum_tum() { }
thank you.
well this is pretty much confusion to me as well, but here is
scenario. I have two shared objects file and one loader executable.
loader calls extern function in shared1 , which has one class ,
initialize it and run its method , which would call extern in shared2.
after shared2 extern function returns, the "this" pointer get 0x00 in
A::Run(),
any guess what would have been happened, I have using gcc version 4+
to build the project.
** loader.cpp
- calls run_test(); in shared1.cpp
** shared1.cpp
class A {
public:
Run() { mum_tum(); doWell(); }
doWell() { }
};
extern void run_test() {
A *a = new A();
a->Run();
}
** shared2.cpp
extern void mum_tum() { }
thank you.