×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2010
    Location
    Pune Maharashtra India
    Posts
    34

    [copy] App exits throwing KERN-EXEC 3

    Hi

    I have downloaded the HttpClientExample from forum.nokia.com

    in that I did some modifications in that.

    I download a image file Saved it successfully.

    Now to display that file on the mobile screen I wrote a class which converts the jpeg image to

    bitmap.

    following is the content of that ImageDecoder.cpp file

    Code:
    #include <eikenv.h>
    #include "SpotOnImageDecoder.h"
    
    CSpotOnImageDecoder::CSpotOnImageDecoder(CActiveSchedulerWait& aActiveSchedulerWait):CActive(EPriorityStandard),iActiveSchedulerWait(aActiveSchedulerWait)
    	{
    	CActiveScheduler::Add(this);
    	}
    
    CSpotOnImageDecoder::~CSpotOnImageDecoder()
    	{
    	Cancel();
    	iFileSession.Close();
    		
    	if(iDecoder)
    		{
    		delete iDecoder;
    		iDecoder = NULL;
    		}
    	if(iBitmap)
    		{
    		delete iBitmap;
    		iBitmap = NULL;
    		}
    	}
    	
    CSpotOnImageDecoder* CSpotOnImageDecoder::NewLC(TDes& aImage, CActiveSchedulerWait& aActiveSchedulerWait)
    	{
    	CSpotOnImageDecoder* self = new (ELeave) CSpotOnImageDecoder(aActiveSchedulerWait);
    	CleanupStack::PushL(self);
    	self->ConstructL(aImage);
    	return self;
    	}
    
    CSpotOnImageDecoder* CSpotOnImageDecoder::NewL(TDes& aImage, CActiveSchedulerWait& aActiveSchedulerWait)
    	{
    	CSpotOnImageDecoder* self=CSpotOnImageDecoder::NewLC(aImage, aActiveSchedulerWait);
    	CleanupStack::Pop(); 
    	return self;
    	}
    
    void CSpotOnImageDecoder::ConstructL(TDes& aImage)
    	{
    	iImage.Copy(aImage);
    	User::LeaveIfError( iFileSession.Connect() );
    	}
    
    void CSpotOnImageDecoder::ConvertToBmpL()
    	{
    
    	 if(iBitmap)
        	{
    	    delete iBitmap;
    	    iBitmap = NULL;
        	}
    	iDecoder=CImageDecoder::FileNewL(iFileSession,iImage);
    	iBitmap=new(ELeave) CFbsBitmap;
    	CleanupStack::PushL(iBitmap);
    	TFrameInfo bmpInfo=iDecoder->FrameInfo();
    	iBitmap->Create(bmpInfo.iOverallSizeInPixels,bmpInfo.iFrameDisplayMode);
    	
        iState = EDecoding;
    	iDecoder->Convert(&iStatus,*iBitmap);
    	CleanupStack::Pop(iBitmap);
    	SetActive();
    
    	}
    
    void CSpotOnImageDecoder::RunL()
    	{
    	if(iStatus==KErrNone)
    		{
    		if(iDecoder)
    			{
    			delete iDecoder;
    			iDecoder = NULL;
    			}
    		}
    	switch( iState ) 
    			{
    			case EDecoding:
    				{	
    				if( iStatus == KErrNone ) 
    					{
    					iState = EIdle;
    					iActiveSchedulerWait.AsyncStop();	
    					break;		
    					}
    				else if(iStatus == KErrUnderflow )
    					{
    					iDecoder->ContinueConvert( &iStatus );
                    	SetActive();
                    	break;
    					}
    				else if ( iStatus == KErrCorrupt )
    	                {
    	                iState = EIdle;
    	               //Inform about the error
    	                break;
    	                }
    	            else
    	                {
    	                // Unknown error
    	                //Inform about the error...
    	                break;
    	                }
    				}
    			default:
    				break;  
    			}
    	}
    
    void CSpotOnImageDecoder::DoCancel()
    	{
    	if( iState == EDecoding )
            {
            iDecoder->Cancel();
            }
    	}
    
    CFbsBitmap* CSpotOnImageDecoder::GetBitmap()
    	{
    	return iBitmap;
    	}
    
    
    //End of File
    Usage of that file in the main application is as follows

    Code:
    void CClientAppView::ClientBodyReceived(const TDesC8& aBodyData,TBool aCompleted,TFileName aFileName)
      {
      TRAPD(err, AddToOutputWindowL(aBodyData));
      if(err)
        Panic(EClientView);
      if(aCompleted)
      {
    		iComplete = aCompleted;
    	  
    		CActiveSchedulerWait* aWait = new (ELeave)CActiveSchedulerWait;
    	    
    	    iDecoder = CSpotOnImageDecoder::NewL(aFileName,*aWait); //pointer
    	    CleanupStack::PushL(iDecoder);
    	    iDecoder->ConvertToBmpL();
    	    aWait->Start();
    	    if(iBitmap)
    	    	delete iBitmap;
    	    
    	    iBitmap=NULL;
    	    iBitmap = iDecoder->GetBitmap();
    	    delete aWait;
    
    
    	    DrawNow();
    	    
      }
      }
    Now as soon as this call completes because of drawNow()

    It displays the image appropriately .

    but immediately it say Panic KERN-EXEC 3 and application crashes

    please help me out
    Last edited by ltomuta; 2010-04-24 at 09:45.

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

    Re: [copy] App exits throwing KERN-EXEC 3

    I would consider it to be double deletion, so check that all stuff are only deleted once, for example, see what is done with the bitmap returned from this class.

Similar Threads

  1. KERN EXEC 0 in File Writing
    By somnathbanik in forum Symbian
    Replies: 3
    Last Post: 2010-03-25, 09:25
  2. kern exec 3 panic
    By ganeshs87 in forum Symbian
    Replies: 7
    Last Post: 2010-03-11, 07:43
  3. getting panic KERN - EXEC 3
    By rohitnegi in forum Symbian User Interface
    Replies: 2
    Last Post: 2010-02-22, 11:01
  4. Replies: 2
    Last Post: 2009-09-08, 08:11
  5. Form does not load and app exits
    By jensesaat in forum Symbian
    Replies: 4
    Last Post: 2006-07-19, 08:08

Posting Permissions

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