From: "Steven Ketcham" <[EMAIL PROTECTED]>
> MSVC 6.0
>
> typedef boost::function0<void> CallBackFunctionEmpty;
> CallBackFunctionEmpty f = boost::bind(&MyClass::SomeFunction,
> classInstance);
>
> The destructor of MyClass is called multiple times.
> Is this correct?

You are storing a copy of classInstance in the function object returned by
boost::bind. If you want to store a pointer or reference, use

boost::bind(&MyClass::SomeFunction, &classInstance);

or

boost::bind(&MyClass::SomeFunction, boost::ref(classInstance));

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to