javauis/javalegacyutils/src/eventserver/TConstructorBase.cpp
changeset 76 4ad59aaee882
parent 69 773449708c84
child 79 2f468c1958d0
equal deleted inserted replaced
69:773449708c84 76:4ad59aaee882
     1 /*
       
     2 * Copyright (c) 1999-2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <mevents.h>
       
    20 
       
    21 EXPORT_C CJavaEventSourceBase::TConstructorBase::TConstructorBase(CJavaEventSourceBase* aObject,JNIEnv& aJni)
       
    22         :iObject(aObject),iJni(aJni)
       
    23 {
       
    24     // This codescanner error is supressed "illegally" away. The reason is that:
       
    25     //   - The method is constructor, so it cannot be "L" method.
       
    26     //   - The possible leave is TRAPped correctly in mevents.h file in CJavaEventSource::New
       
    27     //     method.
       
    28     CleanupStack::PushL(TCleanupItem(&TConstructorBase::Disposer,this)); // codescanner::leave
       
    29 }
       
    30 
       
    31 void CJavaEventSourceBase::TConstructorBase::Disposer(TAny* aThis)
       
    32 {
       
    33     TConstructorBase& t=*static_cast<TConstructorBase*>(aThis);
       
    34     t.iObject->Dispose(t.iJni);
       
    35 }