THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/07/2007 at 11:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R10
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Was the behaivior of Start/Add/EndUndo() changed in R10? My plugin is now crashing the app with an access violation anytime I call AddUndo() (after previously calling StartUndo(), as required).
As far as I know, my plugin (a CommandData based plugin) is not subject to the 'threading' issues mentioned in the docs... but I've also tried putting a StopAllThreads() in front and that didn't help either.
All of this code worked fine when compiled under the R8.206 SDK, so 'something' has changed (if I bypass all the AddUndo() calls, my plugin still works fine otherwise, but I lose all the Undos).
Here's a snippet:
BaseSelect *m_pUserSelected = m_pPolyObj->GetPolygonS();
m_pBaseDoc->StartUndo();
// if no polys selected, select them all...
if( m_pUserSelected->GetCount() == 0 )
{
m_pBaseDoc->AddUndo(UNDO_CHANGE_SELECTION, m_pUserSelected);
m_pUserSelected->SelectAll(0, m_numFaces-1);
}
m_pBaseDoc->EndUndo();
...m_pPolyObj is set up to point at the active PolygonObject and of course m_pBaseDoc is previously set up to point at the active BaseDocument, etc.
Any insight would be appreciated.