# Custom UI crash when 2 users leave at the same time

**URL:** <https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765>\
**Category:** Meeting SDK\
**Created:** [October 12, 2021, 7:58pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765 "2021-10-12T19:58:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [October 12, 2021, 7:58pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/1 "2021-10-12T19:58:11Z")

</div>

**Description**  
Zoom SDK will consistently crash when using the Custom UI and more than 1 person leaves at the same time (within seconds)

**Which Desktop Meeting SDK version?**  
Latest Windows SDK

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Launch Windows sdk with custom UI on
2. join a meeting
3. have 2 people leave at the same time
4. zoom crashes

**Device ):**

- Device: custom gaming computer
- OS: windows 10

**Additional context**

Here I modified the Resubscribe normal user function to send data via anon pipe to an unreal application.

void CCustomizeUIVideoMgr::ReSubscribeNormalUser(GalleryViewSubscribeType nType)  
{  
CalculateTotalPages();  
if (0 == m\_iGalleryTotalPage)  
return;  
if (!m\_pMainUI)  
return;  
CSDKUserList\* pUserList = m\_pMainUI-\>GetUserList();  
if(!pUserList)  
return;

```
int nStart = 0;
int nCurrentPage = m_iGalleryCurrentPage;
switch(nType)
{
case GalleryView_Subscribe_CurrentPage:
	break;
case GalleryView_Subscribe_PrePage:
	nCurrentPage -= 1;
	if(nCurrentPage < 1)
		return;
	break;
case GalleryView_Subscribe_NextPage:
	nCurrentPage += 1;
	break;
default:
	break;
}
nStart = (nCurrentPage-1) * m_iVideoCountInOnePage;
int nTotalCount = pUserList->GetCount();
if (nStart > nTotalCount - 1)
	return;

if(nStart < 0 )
	nStart = 0;

m_iGalleryCurrentPage = nCurrentPage;
int nElemIndex = 0;
int beanos = 0;
stringstream ss;
for (int i = nStart; (i < nTotalCount && nElemIndex < m_iVideoCountInOnePage); i++)
{
	ZOOM_SDK_NAMESPACE::IUserInfo* pUser = pUserList->GetItem(i);
	if(!pUser || pUser == NULL)
		continue;

	unsigned int nUserID = pUser->GetUserID();

	if (NULL == nUserID || NULL == m_pNormalElemGallery[nElemIndex] || pUser->IsInWaitingRoom())
		continue;

	if (pUser->GetUserNameW() != NULL) {
		wstring ws(pUser->GetUserNameW());
		string str(ws.begin(), ws.end());
		ss << nUserID << " " << str << endl;
		beanos++;
	}

	if (nUserID != m_pNormalElemGallery[nElemIndex]->GetCurrentRenderUserId() && pUser->IsVideoOn())
	{
		m_pNormalElemGallery[nElemIndex]->Subscribe(nUserID);
		nElemIndex++;
	}
	else if(nUserID == m_pNormalElemGallery[nElemIndex]->GetCurrentRenderUserId() && GalleryView_Subscribe_CurrentPage == nType)
	{
		nElemIndex++;
	}
}

stringstream out;

out << beanos << endl << ss.rdbuf();

myPipe::getInst()->send(UserMapUpdate, out);

if (nElemIndex < (m_iVideoCountInOnePage-1))
{
	for (;nElemIndex < m_iVideoCountInOnePage; nElemIndex++)
	{
		if (NULL == m_pNormalElemGallery[nElemIndex])
			continue;
		if (0 != m_pNormalElemGallery[nElemIndex]->GetCurrentRenderUserId())
			m_pNormalElemGallery[nElemIndex]->Unsubscribe(m_pNormalElemGallery[nElemIndex]->GetCurrentRenderUserId());
	}
}

```

}

And here I modified this function to send data based on what users are diplayed to gather further data.

void CCustomizeUIVideoMgr::ShowGalleryViewVideo(GalleryViewSubscribeType nType)  
{   
//DestroyGalleryViewVideo();  
DestroyNonVideoUsers();  
CreateGalleryViewVideo();  
ReSubscribeNormalUser(nType);  
int nElementHight = (m\_rcGalleryView.bottom-m\_rcGalleryView.top) / 3;  
int nElementWid = (m\_rcGalleryView.right - m\_rcGalleryView.left) / 3;  
int iShowed = 0;

```
stringstream pack;

for (int i = 0; i < m_iVideoCountInOnePage; i++)
{
	ZOOM_SDK_NAMESPACE::INormalVideoRenderElement* pElementNormal = m_pNormalElemGallery[i];
	if (pElementNormal)
	{
		RECT element_rc_ = m_rcGalleryView;
		element_rc_.top = (iShowed % 3) * nElementHight;
		element_rc_.bottom = nElementHight + element_rc_.top;
		element_rc_.left = (iShowed / 3) * nElementWid;
		element_rc_.right = nElementWid + element_rc_.left;
		pElementNormal->SetPos(element_rc_);

		if (pElementNormal->GetCurrentRenderUserId() > 0)
		{
			m_customUIVideoFlow.ShowGalleryViewVideo(pElementNormal, element_rc_);
			iShowed++;
			m_bIsGalleryViewShown = true;
			pack << pElementNormal->GetCurrentRenderUserId() << endl;
		}
		else
		{
			m_customUIVideoFlow.HideGalleryViewVideo(pElementNormal);
		}
	}
}

stringstream out;

out << iShowed << endl << pack.rdbuf();

myPipe::getInst()->send(DisplayArrayUpdate, out);

```

}

FYI the myPipe::getInst()-\>send(const stringstream& ss) function DOES run in the main thread and while I am doing some multithreading for seperate tasks occasionally, I am not involving them in any zoom sdk dealings whatsoever.

This error occurs consistently when more than 1 person leaves at the same time, REGARDLESS if their webcam is on or not.

---

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [October 12, 2021, 8:14pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/2 "2021-10-12T20:14:25Z")

</div>

error=“Only part of a ReadProcessMemory or WriteProcessMemory request was completed.”/\>

Is in the XML log

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [October 15, 2021, 12:52am UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/3 "2021-10-15T00:52:09Z")

</div>

Hey @Wolf_Isaac,

Thanks for using the dev forum!

What version of the SDK are you using?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [October 15, 2021, 4:01pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/4 "2021-10-15T16:01:04Z")

</div>

5.7.1.644 is my version that I am currently using

---

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [October 15, 2021, 4:17pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/5 "2021-10-15T16:17:52Z")

</div>

However I have just run the same test on the 64bit 5.7.6 and I still encounter the same access reading violation crash

---

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [October 15, 2021, 4:18pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/6 "2021-10-15T16:18:56Z")

</div>

to reproduce,

join meeting in custom gui.

show gallery view video.

have two video users on the same page leave at the same time.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [October 20, 2021, 10:42pm UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/7 "2021-10-20T22:42:23Z")

</div>

Hey @Wolf_Isaac,

We are investigating a fix for this.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 20, 2021, 8:43am UTC](https://devforum.zoom.us/t/custom-ui-crash-when-2-users-leave-at-the-same-time/58765/8 "2021-11-20T08:43:07Z")

</div>

Closed on November 20, 2021, 8:43am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
