×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    62

    Help with KERN-EXEC 3 panic

    Hi there,

    Can you pls help me with this, i am trying to implement this calendar an i cannot figure out what i am doing wrong.

    This is my function which creates a new appointment in my own calendar file.
    If i leave out the "CleanupStack::PopAndDestroy(&entryArray);" it seems to be working, but i am affraid of memory leaks.


    Code:
    void CCallCalendar::NewApptL(const TDesC& aSubject, const TDesC& aStart, const TDesC& aEnd)
        {
        if(!iReady) //if this function is called too soon then return. Calendar opening 
    		{
        	return;         //must finish first.
    		}
        
        TInt num = 0;
        TBuf8<16> newID;
        newID.Num(num);
        RPointerArray<CCalEntry> entryArray;
        CleanupStack::PushL(TCleanupItem(DestroyRPointerArray, &entryArray));
    	
        // Search for an ID not in use
        FillArray(entryArray);
        while(entryArray.Count() != 0)
             {
    	 num++;
    	 newID.Num(num);
    	 entryArray.ResetAndDestroy();
    	 iCalEntryView->FetchL(newID, entryArray);
    	 }
        // Not necessary. because array.Count() is 0
        // array.Reset();
    	
        // Set the new ID for the creating appointment
        HBufC8* guid = newID.AllocL();
     
        CCalEntry* entry = CCalEntry::NewL(CCalEntry::EAppt, guid, CCalEntry::EMethodNone, 0);
        CleanupStack::PushL(entry);
     
        //Some data
        entry->SetSummaryL( _L("") ); 
        entry->SetLocationL( _L("") );
        //appt->SetDescriptionL( _L("limit") );
        entry->SetDescriptionL(aSubject);
        
        TTime start,end;
        start.Set(aStart);
        end.Set(aEnd);
    
        TCalTime startCalTime;
        startCalTime.SetTimeUtcL(start);
        TCalTime endCalTime; //NullTTime()
        //Comment out the next line if you do not want to set end time
        endCalTime.SetTimeUtcL(end);
        //Set it
        entry->SetStartAndEndTimeL(startCalTime, endCalTime);
     
        //Store this new Entry
        entryArray.AppendL(entry);
        TInt success(0);
        iCalEntryView->StoreL(entryArray, success);
        //entryArray.Reset();
        CleanupStack::PopAndDestroy(entry);
        CleanupStack::PopAndDestroy(&entryArray);
        }


    Code:
    // Utility function to handle CCalEntry insert
    // Destroy the RPointerArray
    void DestroyRPointerArray(TAny* aPtr)
        {
        RPointerArray<CCalEntry>* self = static_cast<RPointerArray<CCalEntry>*> (aPtr);
        self->ResetAndDestroy();
        }
    Code:
    // Fill the array with all the entries of the calendar
    void CCallCalendar::FillArray(RPointerArray<CCalEntry> &array)
    	{
    	TPtrC8 entryID;
    	entryID.Set(iCalIter->FirstL());
    	while (entryID != KNullDesC8)
    		{
    		iCalEntryView->FetchL(entryID, array);
    		entryID.Set(iCalIter->NextL());
    		}
    	}

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: Help with KERN-EXEC 3 panic

    I would suppose it is because the pointer array is holding a entry that is already deleted, thus it is getting double deleted..

Similar Threads

  1. KERN EXEC 3 Panic when try to call .pyd
    By SymbianTH in forum Python
    Replies: 9
    Last Post: 2009-07-09, 09:11
  2. EXit() returns Kern Exec 3 panic
    By jey_ in forum Symbian C++
    Replies: 5
    Last Post: 2009-03-03, 14:17
  3. panic kern exec 3 error need help
    By urban37 in forum Symbian User Interface
    Replies: 13
    Last Post: 2008-12-17, 08:24
  4. Replies: 4
    Last Post: 2008-03-05, 09:30
  5. Replies: 2
    Last Post: 2007-07-19, 01:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •