os/kernelhwsrv/kerneltest/e32test/misc/t_destruct_dll2.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32test\misc\t_destruct2.cpp
    15 // 
    16 //
    17 
    18 #include <e32debug.h>
    19 #include <e32msgqueue.h>
    20 #include "t_destruct.h"
    21 
    22 class TTestObjectDynamic
    23 	{
    24 public:
    25 	TTestObjectDynamic();
    26 	~TTestObjectDynamic();
    27 	};
    28 
    29 TTestObjectDynamic GlobalObjectWithDestructor;
    30 
    31 void Panic(TInt aReason)
    32 	{
    33 	User::Panic(_L("t_destruct_dll2"), aReason);
    34 	}
    35 
    36 TTestObjectDynamic::TTestObjectDynamic()
    37 	{
    38 	RDebug::Printf("t_destruct_dll2 constructor called\n");
    39 	TInt r;
    40 	RMsgQueue<TMessage> messageQueue;
    41 	r = messageQueue.OpenGlobal(KMessageQueueName);
    42 	if (r != KErrNone)
    43 		Panic(r);
    44 	r = messageQueue.Send(EMessageConstructDynamic);
    45 	if (r != KErrNone)
    46 		Panic(r);
    47 	messageQueue.Close();
    48 	}
    49 
    50 TTestObjectDynamic::~TTestObjectDynamic()
    51 	{
    52 	RDebug::Printf("t_destruct_dll2 destructor called\n");
    53 	TInt r;
    54 	RMsgQueue<TMessage> messageQueue;
    55 	r = messageQueue.OpenGlobal(KMessageQueueName);
    56 	if (r != KErrNone)
    57 		Panic(r);
    58 	r = messageQueue.Send(EMessageDestructDynamic);
    59 	if (r != KErrNone)
    60 		Panic(r);
    61 	messageQueue.Close();
    62 	}
    63 
    64 EXPORT_C void DynamicMain()
    65 	{
    66 	}