datacommsserver/esockserver/ssock/ss_connselect.cpp
changeset 65 41cc8e7ff496
parent 22 592244873960
equal deleted inserted replaced
40:34fc115b8742 65:41cc8e7ff496
   129 					TInt idx = FindActiveRequest(aSender);
   129 					TInt idx = FindActiveRequest(aSender);
   130 					if (idx != KErrNotFound && !(iActiveRequests[idx].Flags() & TClientType::ELeaving))
   130 					if (idx != KErrNotFound && !(iActiveRequests[idx].Flags() & TClientType::ELeaving))
   131 						{
   131 						{
   132 						RNodeInterface::OpenPostMessageClose(Id(), aSender, TEChild::TLeft().CRef());
   132 						RNodeInterface::OpenPostMessageClose(Id(), aSender, TEChild::TLeft().CRef());
   133 						iActiveRequests[idx].SetFlags(TClientType::ELeaving);
   133 						iActiveRequests[idx].SetFlags(TClientType::ELeaving);
   134 						}
   134 	                    if (aSender == iTopMcprId)
   135 										
   135 	                        {
   136 					if (aSender == iTopMcprId)
   136 	                        iTopMcprId.SetNull();
   137 						{
   137 	                        }						
   138 						iTopMcprId.SetNull();
       
   139 						}
   138 						}
   140 					}
   139 					}
   141 				SelectionError(aSender, error.iValue);
   140 				SelectionError(aSender, error.iValue);
   142 				}
   141 				}
   143 			}
   142 			}
   258 void CSelectionRequest::InitialiseDestroy()
   257 void CSelectionRequest::InitialiseDestroy()
   259 	{
   258 	{
   260 	__ASSERT_DEBUG(!iDestroying, User::Panic(KSpecAssert_ESockSSockscnslc, 17));
   259 	__ASSERT_DEBUG(!iDestroying, User::Panic(KSpecAssert_ESockSSockscnslc, 17));
   261 	iDestroying = ETrue;
   260 	iDestroying = ETrue;
   262 
   261 
   263     //We are not ready to destruct ourselves yet, waiting for TErrors
       
   264     if (iActiveRequests.Count()!=0)
   262     if (iActiveRequests.Count()!=0)
   265     	{
   263     	{
       
   264       /*
       
   265       Unfortunatelly today the parent of 'this' (CConnection or CFlowRequest) doesn't handle ownership
       
   266       with 'this' very well and it may (in cancelation scenarios it will) bail out right after posting TDestroy
       
   267       to 'this'. This is not good because the TSelect protocol carries data owned by the parent (selection preferences)
       
   268       and MCPRs may attempt to access them after the owner/parent has gone away. We're making it illegal for the
       
   269       parent to post TDestroy before all requests are completed. Consequently before posting TDestroy the parent 
       
   270       must make sure the selection is complete by awaiting response to the TSelect protocol. If it wants to
       
   271       terminate selection it _must_ send TCancel (and await responses) before posting TDestroy.
       
   272       */
       
   273         __ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_ESockSSockscnslc, 44)); 
   266     	return;
   274     	return;
   267     	}
   275     	}
   268 
   276 
   269 	//We have never joined the top mcpr, clear it now
   277 	//We have never joined the top mcpr, clear it now
   270 	if (!iJoined)
   278 	if (!iJoined)