switch to alternate method of clearing function objects

may help with null_ptr related issues when using boost with c++11
compilers