[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] writing primitives



On Wednesday, November 27, 2002, at 12:19 AM, James McCartney wrote:


you need to #include "GC.h"

right.

now i crash:

            int i;
            int count = [urls count];
            // array to return
PyrObject *scArray = (PyrObject*)instantiateObject(g->gc, class_array, count, false, true);
            SetObject(receiver,scArray);
            //g->gc->GCWrite(scArray,receiver);

            for (i = 0; i < count; i++)
            {
                NSString *nspath = [[urls objectAtIndex: i ] path];
                NSLog (@"Object at index %d is: %@", i, nspath);

PyrString* pyrPathString = newPyrString(g->gc,[nspath cString],0,true);

                PyrSlot *slot;
                SetObject(slot,pyrPathString);
                putIndexedSlot(g ,scArray,slot  ,count);
                g->gc->GCWrite(scArray,pyrPathString);
            }



Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
Thread 0 Crashed:

#0 0x0006c820 in prGetPathsDialog(VMGlobals*, int) (CocoaFilePrimitives.M:142) #1 0x0006c814 in prGetPathsDialog(VMGlobals*, int) (CocoaFilePrimitives.M:92)
 #2   0x000355cc in Interpret(VMGlobals*) (PyrInterpreter3.cpp:1855)
 #3   0x00032aa4 in runInterpreter (PyrInterpreter3.cpp:367)
 #4   0x000398b4 in runLibrary (PyrLexer.cpp:1862)
 #5   0x0000d36c in -[MyDocument sendSelection:] (MyDocument.M:564)
 #6   0x00010f2c in -[SCTextView keyDown:] (SCTextView.M:62)
 #7   0x9336e63c in -[NSWindow sendEvent:]
 #8   0x930ce328 in -[NSApplication sendEvent:]
 #9   0x930ca524 in -[NSApplication run]
 #10  0x930d2598 in NSApplicationMain
 #11  0x00004ae8 in _start (crt.c:267)
 #12  0x00004968 in start


-felix