From: xie xingguo Date: Tue, 2 Aug 2016 07:02:49 +0000 (+0800) Subject: osd: initialize class_handler of OSD properly X-Git-Tag: ses5-milestone5~180^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30cffa0653f7260618c5f8a3b56641e099b59c9a;p=ceph.git osd: initialize class_handler of OSD properly The destructor of OSD will delete class_handler arbitrarily and there are cases we'll fail to start an osd before we load the class_handler correctly. So it is safe to initialize class_handler to NULL as to avoid access violation. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 325c845e34a..65c4b3555af 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1234,7 +1234,7 @@ protected: bool asok_command(string command, cmdmap_t& cmdmap, string format, ostream& ss); public: - ClassHandler *class_handler; + ClassHandler *class_handler = nullptr; int get_nodeid() { return whoami; } static ghobject_t get_osdmap_pobject_name(epoch_t epoch) {