Crashes with update to R15 API

On 10/02/2014 at 05:45, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R15 
Platform:   Windows  ;   Mac OSX  ; 
Language(s) :     C++  ;

---------
This code is crashing Cinema 4D in R15 only (no problems from R10 to R14) :

// GreeblerObj.SplitSelection  
// - Split PolygonSelection off into new Object  
//*---------------------------------------------------------------------------*  
PolygonObject* GreeblerObj::SplitSelection(BaseObject* op)  
//*---------------------------------------------------------------------------*  
{  
  ModelingCommandData    gmcd;  
  gmcd.doc =                    NULL;  
  gmcd.bc =                    NULL;  
  gmcd.mode =                    MODELINGCOMMANDMODE_POLYGONSELECTION;  
  gmcd.flags =                MODELINGCOMMANDFLAGS_0;  
  gmcd.op =            op;  
  // Split selected polygons (tops) into new object  
  if (!(SendModelingCommand(MCOMMAND_SPLIT, gmcd) && gmcd.result))    return NULL;  
  PolygonObject*    top =    ToPoly(gmcd.result->GetIndex(0L));  
  AtomArray::Free(gmcd.result);  
  if (!top)            return NULL;  
  // Add to object iarray  
  iarray->Append(top);  
  return top;  
}

The bugreport goes like this:

    Exception  
  {  
      ExceptionNumber = 0xC0000005  
      ExceptionText = "ACCESS_VIOLATION"  
      Address = 0x00007FF6C6C53365  
      Thread = 3972  
      Last_Error = 0x00000006  
  }  
  Call_Stacks  
  {  
      Call_Stack_Thread_3972  
      {  
          CINEMA 4D 64 Bit.exe: 00007FF6C6C53365  
          modeling.cdl64: 00007FFE308CD7E8  
          CINEMA 4D 64 Bit.exe: 00007FF6C608FD4E  
          CINEMA 4D 64 Bit.exe: 00007FF6C608F9A8  
          CINEMA 4D 64 Bit.exe: 00007FF6C5C60E88  
          CINEMA 4D 64 Bit.exe: 00007FF6C5CDDBD9  
          modeling.cdl64: 00007FFE30996020  
          modeling.cdl64: 00007FFE306FC19B  
          Greebler.cdl64: 00007FFE2CC1A625 GreeblerObj::SplitSelection  
          Greebler.cdl64: 00007FFE2CC1780B GreeblerObj::PrepareThreads  
          Greebler.cdl64: 00007FFE2CC17112 GreeblerObj::Greeble_Mesh  
          Greebler.cdl64: 00007FFE2CC1602A GreeblerObj::Greeble_Tag  
          Greebler.cdl64: 00007FFE2CC1590F GreeblerObj::Generate  
          Greebler.cdl64: 00007FFE2CC214A0 GreeblerObj::GetVirtualObjects  

op and iarray are (or had better be) valid!

On 10/02/2014 at 10:12, xxxxxxxx wrote:

Not sure but may be doc need to be not NULL too ?

  
    
    
    gmcd.doc = doc;

On 11/02/2014 at 04:42, xxxxxxxx wrote:

I have considered that, but there is no mention of a change requiring a document despite it having never needed one before.  Let's try it and see what happens. :)