- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I was running some tests on my plugins with VS2013 and compiled by code with debug flags and started encountering an error that I could not reproduce on a release version of my libraries. At one point in my code I called IParamBlock2 -> getValue(PBBitmap) and would try to load it and do various operations on the bitmap. In my release it worked fine, the bitmap would load, i could use it as expected. In debug I would crash with some improperly instantiated bitmap, this issue did not occur in previous iterations of our plugins (max08/max11).
Soon it was realized that when getting the values in a debug configuration the bm member of the PBBitmap would not come instantiated as NULL instead would be a pointer with a no mans land address (0xabababab). After various amounts of poking around we decided to check on the sizeof the classes in both debug and release and got the following:
debug | PBBitmap:704 BitmapInfo:696 Bitmap:96 release | PBBitmap:696 BitmapInfo:688 Bitmap:96
So we dug a bit further into BitmapInfo and found this in the MaxSDK::Util::Path which is a member of the class
class PathImpl; const AutoPtr<PathImpl> mImpl; #if defined(_DEBUG) //! Useful for inspecting the path in the debugger const MCHAR* mdata; #endif
So it seems that when we compile under debug, VS assumes that we have this mdata and starts pulling all sorts of strange quirks with the code while our included libraries are only release compiled.
Assuming we can't get the debug libraries for max, is there some sort of workaround for this issue?
I can delete the #if code from my local header files but i wonder why this code was left here anyways
Solved! Go to Solution.
