EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby flgBill » Tue Aug 23, 2011 4:50 pm

Hi Brady,

I've been getting a NullReferenceException from UIScrollList (in EZ GUI 1.06 b36). It happens in this if-statement in the method RemoveItem(int index, bool destroy):

Code: Select all
        if (lastClickedControl != null &&
            (lastClickedControl == items[index] || lastClickedControl.Container.Equals(items[index])))
            lastClickedControl = null;


I added some debug output and found that lastClickedControl.Container could be null.

To fix this error, I wasn't sure if .Equals was necessary (as opposed to using ==), so I took the safest route and left it in. My fix just checks if lastClickedControl.Container is null before doing the .Equals comparison.

Let me know if an easier fix, like using == or items[index].Equals, will work instead. :)
flgBill
 
Posts: 45
Joined: Mon May 09, 2011 8:22 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby Brady » Tue Aug 23, 2011 11:26 pm

Thanks for the catch. Please let me know if this does the trick for you:
Code: Select all
      if (lastClickedControl != null &&
         (lastClickedControl == items[index] || (lastClickedControl.Container != null && lastClickedControl.Container.Equals(items[index]))) )
         lastClickedControl = null;
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby corey_stpierre » Mon Aug 29, 2011 6:57 pm

Hi Brady,

I am getting a SIGBUS from using RemoveItem on my scroll list. I used the above code to fix the potential null, but I know that it's not causing the error I'm getting.

I'm using a vertical scroll list to hold profile names. The items are created at runtime from a prefab. What's strange is that the item is actually removed, but the rest of the items are not sized correctly after the call to RemoveItem. The list items are just text with a transparent rectangular graphic behind it (non-transparent when selected). The items appear scrunched up right on top of one another separated by a pixel instead of being separated by the height of the rectangular graphic that was set in the control's editor. The SIGBUS occurs when I touch anywhere on the viewable area of the scroll list's window. Here are the images of what it should look like and what's actually happening:

It should look like this (here there is no call to RemoveItem):

ProfileGOOD.png
Should look like this.


Using RemoveItem (on a single list item), it looks like this, and the SIGBUS occurs when touching the scroll list's window:

ProfileBAD.png
After using RemoveItem on one list item.


Here's my stacktrace:

Thread 1 (thread 11779):
#0 0x002ebebc in UnityEngine_Object_Equals_object ()
#1 0x0036a770 in UIManager_DispatchHelper_POINTER_INFO__int ()
#2 0x00000000 in ?? ()

I'm using Unity iPhone Pro 1.7 (sadly I know) and originally I was getting some generics errors, because UIScrollList.cs uses 4 generic Lists. So I changed those out for ArrayLists and made the corresponding changes throughout the file. Note that everything works perfect in the editor, no crashes what so ever. So I'm really stressing out here because I need RemoveItem to work. I'm using it in my profile menu, (via EZ GameSaver), to delete a user profile. It's crucial that I find a solution. I'm using 1.06 b31.
corey_stpierre
 
Posts: 49
Joined: Tue Dec 07, 2010 10:31 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby Brady » Mon Aug 29, 2011 7:28 pm

Lots of stuff was fixed and tweaked in UIScrollList since beta 31. Have you tried the "golden" 1.06? If that doesn't work, if possible, could you e-mail me directly with a package that reproduces the issue I could test? Thanks!
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby corey_stpierre » Mon Aug 29, 2011 7:30 pm

Sure I'll give that a go. I'll report back later today. Thanks.
corey_stpierre
 
Posts: 49
Joined: Tue Dec 07, 2010 10:31 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby corey_stpierre » Tue Aug 30, 2011 2:11 am

Hi Brady,

I upgraded both EZGUI and SM2 to their latest versions (1.06 and 1.85 respectively), but I am still getting the same error. I created a simple package that demonstrates the issue and I sent it to you via email.

I look forward to hearing back from you. Again, I'm using Unity iPhone 1.7 advanced. If you need anything else from me let me know.

Thanks a lot.
corey_stpierre
 
Posts: 49
Joined: Tue Dec 07, 2010 10:31 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby corey_stpierre » Fri Sep 02, 2011 3:10 am

Hi Brady, Just wanted to tell you that I fixed it, FINALLY. Perhaps you can elaborate on why it works the way I fixed it. And if the fix isn't just specific to my case, but will work for all cases.

The culprit was in RemoveItem(), specifically the line:

visibleItems.Remove(items[index]); (in my case it's visibleItems.Remove(anItem) where anItem is items[index] casted to an IUIListObject because of generics removal).

Anyhow I think problem was that since I am not using generics, the call to ArrayList.Remove was finding the first instance of the passed object. And since I am using a prefab as the list item, it removed the very first instance which might not be the actual object chosen to be removed. Thus upon positioning the items, the very top item in the list was always positioned incorrectly (and since the first one was positioned incorrectly the whole list got messed up). This lead me to believe that the visible items list was not getting rid of the right item. So here's what I did. Since using ArrayList.Remove was giving the wrong result, I used ArrayList.RemoveAt and used a hard reference check to make sure I was using the correct index for removal:

//replace visibleItems.Remove(anItem) with:

Code: Select all
// Remove the item from our visible list, if it's there:
      IUIListObject theItem;
      for (int i = 0; i < visibleItems.Count; i++) {
         theItem = visibleItems[i] as IUIListObject;
         
         if (anItem == theItem) {
            visibleItems.RemoveAt(i);
            break;
         }
      }


I am pretty sure this fix is going to always work because it's just using a hard reference check to ensure the correct removal. Using generics must be able to remove the object without penalty, thus the call to Remove worked.

So happy to have found this bug. I ended up double checking my generic code changes and everything looks great.

Thanks again for your support!!! Best in class.
corey_stpierre
 
Posts: 49
Joined: Tue Dec 07, 2010 10:31 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby flgBill » Fri Sep 02, 2011 4:53 pm

Brady wrote:Thanks for the catch. Please let me know if this does the trick for you:
Code: Select all
      if (lastClickedControl != null &&
         (lastClickedControl == items[index] || (lastClickedControl.Container != null && lastClickedControl.Container.Equals(items[index]))) )
         lastClickedControl = null;


Yup, this does it. :)
flgBill
 
Posts: 45
Joined: Mon May 09, 2011 8:22 pm

Re: EZ GUI 1.06 b36 bug: UIScrollList NullReferenceException

Postby Brady » Sat Sep 03, 2011 6:29 pm

@corey_stpierre

That is strange, since the Remove() method should be identifying by reference, and whether or not your object was instantiated from prefab, it should be comparing the actual instance rather than the prefab reference, so it should be unique. It almost sounds as though somehow the same item was getting added to the list twice or something. Perhaps somewhere in the modifications you made to the way lists are handled, there is some bit that causes an item to get added to the list more than once? If not the whole scroll list, perhaps just to the visible items list? Not sure... but you definitely seem to have found a solution for your case. The fact that this isn't reproducible with the standard distribution makes me agree with you that, for one reason or another, this must be specific to the non-generic implementation you're using.

Thanks a lot for following up!
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

chanyuan

Postby chanyuan » Tue May 09, 2017 9:41 am

chanyuan2017.05.09
new balance outlet
coach outlet store
longchamp outlet online
christian louboutin sale
cheap ray ban sunglasses
ferragamo outlet
cheap oakley sunglasses
lacoste outlet
christian louboutin shoes
cheap ray ban sunglasses
valentino shoes
coach factory outlet
fitflops
mlb jerseys
polo outlet stores
michael kors outlet online
cheap ray bans
longchamp
oakley sunglasses wholesale
ferragamo shoes
hollister shirts
true religion jeans
nike free running
true religion outlet
michael kors outlet
fitflops sale clearance
chrome hearts outlet
vans outlet
yeezy boost
pandora charms sale clearance
coach outlet
mont blanc pens
true religion canada
nba jerseys
true religion jeans outlet
michael kors outlet clearance
michael kors outlet clearance
ray bans
los angeles lakers
oakley sunglasses wholesale
cheap oakley sunglasses
omega outlet
polo outlet
polo ralph lauren
fitflops sale clearance
michael kors handbags
rolex outlet
adidas wings shoes
coach factory outlet
pandora outlet
nike blazer pas cher
coach outlet online
ralph lauren outlet
michael kors outlet clearance
louis vuitton outlet online
ralph lauren polo
michael kors outlet
jordan 4
kate spade uk
mlb jerseys
ralph lauren outlet
ralph lauren
coach outlet
air max 90
coach outlet
adidas outlet
louis vuitton outlet stores
michael kors handbags
coach outlet online
swarovski jewelry
rolex watches outlet
cheap jordan shoes
ralph lauren
lacoste shirts
ralph lauren outlet
ralph lauren outlet
cheap oakley sunglasses
cheap oakley sunglasses
nike shoes uk
air force 1 shoes
cheap ray ban sunglasses
coach outlet store online
coach outlet online
cartier watches for women
polo ralph lauren
mulberry outlet,mulberry handbags outlet
camisetas futbol baratas
cheap football shirts
louis vuitton outlet
ed hardy outlet
kd shoes
coach outlet online coach factory outlet
polo ralph lauren
hermes birkin bag
louis vuitton handbags
kobe 9 elite
polo ralph lauren outlet
michael kors handbags clearance
louis vuitton outlet online
converse shoes sale
louis vuitton outlet
michael kors outlet store
nike trainers uk
oakley sunglasses sale
louis vuitton
oakley sunglasses wholesale
rolex watches for sale
prada outlet
michael kors outlet
cheap mlb jerseys
ferragamo outlet
ralph lauren outlet
mulberry handbags
adidas shoes
mcm outlet
longchamp outlet
prada sunglasses for women
cheap ray ban sunglasses
coach outlet
coach outlet online
ralph lauren polo
oakley sunglasses wholesale
soccer cleats
polo ralph lauren
polo ralph lauren
coach factory outlet
coach outlet online
jerseys wholesale
true religion jeans sale
cheap oakley sunglasses
ray ban sunglasses outlet
ralph lauren
nfl jerseys
louis vuitton outlet online
ray ban sunglasses
michael kors canada
louis vuitton outlet
burberry outlet store
coach outlet online
oakley sunglasses wholesale
louis vuitton
louis vuitton outlet
louis vuitton
christian louboutin sale
coach factory outlet
mizuno shoes
cheap oakley sunglasses
coach outlet
nike outlet store
mulberry handbags
polo ralph lauren outlet
mac cosmetics sale
coach outlet
nike shoes for women
christian louboutin
louis vuitton outlet
fitflops
fred perry polo
coach outlet store online
christian louboutin
true religion outlet
nike trainers
tory burch outlet online
cazal outlet
michael kors outlet online
michael kors outlet
ralph lauren outlet stores
michael kors outlet clearance
michael kors outlet
cheap nfl jerseys
coach outlet
giuseppe zanotti shoes
cheap oakley sunglasses
nike trainers
prada outlet
gucci outlet
cheap oakley sunglasses
oakley sunglasses
tory burch outlet online
ray ban sunglasses
coach outlet online
longchamp handbags
coach factory outlet
true religion outlet uk
michael kors handbags
louis vuitton uk
coach outlet clearance
nike shoes
tory burch outlet online store
air max 2015
pandora jewellery
gucci outlet store
cartier outlet
ray-ban sunglasses
michael kors outlet stores
gucci outlet online
michael kors factory outlet
louis vuitton outlet online
herve leger dresses
polo ralph lauren
coach outlet online coach factory outlet
michael kors outlet clearance
nhl jerseys
louis vuitton
polo shirts
coach outlet
nfl jersey
michael kors outlet clearance
coach outlet online
rolex watches,rolex replica watches,replica rolex watches,replica watches
thomas sabo charms
michael kors outlet clearance
burberry canada
tory burch outlet stores
puma shoes
hollister shirts
ray-ban sunglasses
louis vuitton outlet stores
coach outlet store online
polo ralph lauren outlet
coach outlet
michael kors outlet online
michael kors outlet clearance
coach outlet
juicy couture tracksuit
coach outlet store online
fitflops sale clearance
roshe run
louis vuitton
louis vuitton outlet online
swarovski uk
oakley sunglasses wholesale
air max 90
true religion outlet
ray ban sunglasses wholesale
longchamp outlet
coach outlet
louis vuitton outlet
michael kors handbags outlet
cheap oakley sunglasses
coach outlet
ray ban sunglasses
adidas nmd runner
cheap oakley sunglasses
louis vuitton outlet store
louis vuitton outlet
cheap ray ban sunglasses
louis vuitton
cheap ray ban sunglasses
true religion jeans
longchamp
snapbacks wholesale
michael kors outlet clearance
gucci outlet online
michael kors outlet online
mulberry handbags sale
michael kors outlet
lebron shoes
ralph lauren outlet
ysl outlet online
michael kors outlet online
cheap oakley sunglasses
pandora outlet
louis vuitton bags
coach outlet online
birkenstock shoes
polo outlet stores
fitflops uk
rolex watches
michael kors outlet online
pandora jewelry
kobe bryants shoes
christian louboutin outlet
cheap jordans for sale
louis vuitton
christian louboutin outlet
fitflops uk
cheap jordan shoes
true religion jeans
ferragamo shoes
louis vuitton outlet
links of london jewellery
michael kors outlet online
kobe shoes
polo outlet store
true religion outlet
salomon outlet
cheap jordan shoes
louis vuitton
mulberry handbags sale
coach outlet
nike air huarache
tory burch outlet online
tods outlet online
coach outlet online
ray ban wayfarer
cheap oakley sunglasses
michael kors outlet clearance
ralph lauren uk
longchamp handbags
nike uk store
coach factory outlet
rolex watches,rolex watches,swiss watches,watches for men,watches for women,omega watches,replica watches,rolex watches for sale,rolex replica,rolex watch,cartier watches,rolex submariner,fake rolex,rolex replica watches,replica rolex
ray ban sunglasses
cheap jerseys wholesale
chrome hearts
cheap replica watches
nfl jerseys
mcm handbags
cheap jordans
true religion jeans
nfl jersey wholesale
supra shoes sale
coach factory outlet
fitflops
michael kors uk
michael kors outlet clearance
polo pas cher
coach outlet online
soccer jerseys wholesale
tory burch outlet
cheap ray ban sunglasses
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
basketball shoes,basketball sneakers,lebron james shoes,sports shoes,kobe bryant shoes,kobe sneakers,nike basketball shoes,running shoes,mens sport shoes,nike shoes
instyler
ralph lauren outlet
swarovski outlet
reebok shoes
burberry outlet store
coach outlet online
gucci outlet online
adidas uk store
cartier watches for sale
beats headphones
coach outlet
coach outlet online
michael kors uk
hollister clothing store
fitflops sale clearance
ralph lauren shirts
christian louboutin shoes
michael kors outlet
cheap soccer jerseys
nfl jersey wholesale
cartier watches for sale
michael kors outlet
reebok shoes
mulberry bags
oakley sunglasses wholesale
cartier watches
louis vuitton outlet
oakley sunglasses sale
louis vuitton
cheap oakley sunglasses
kate spade uk
polo outlet
louis vuitton borse
sac louis vuitton pas cher
cheap nba jerseys
rolex orologi
nike air huarache
rolex watches
nike roshe run
ferragamo shoes sale
michael kors outlet clearance
hollister
nike outlet online
coach outlet online
burberry outlet sale
true religion uk
ralph lauren polo
christian louboutin outlet
michael kors outlet
coach outlet online
cheap oakley sunglasses
iphone case uk
cheap oakley sunglasses
coach outlet
oakley sunglasses wholesale
christian louboutin shoes
ralph lauren
coach outlet store online
foamposite shoes
ferragamo shoes
oakley sunglasses wholesale
mulberry uk
air max 90
ralph lauren uk
true religion jeans
tory burch outlet online
oakley sunglasses wholesale
cheap jordans free shipping
cheap nike shoes
michael kors outlet online
oakley sunglasses
coach outlet online
yeezy boost 350
bottega veneta outlet online
mulberry outlet
coach outlet clearance
oakley sunglasses
marc jacobs sale
michael kors outlet
michael kors wallets for women
christian louboutin uk
coach outlet
hermes outlet
hermes belts
hermes outlet store
oakley sunglasses wholesale
ferragamo outlet
michael kors handbags
kate spade
coach factory outlet
louis vuitton handbags
michael kors outlet online
mont blanc outlet
oakley sunglasses sale
coach outlet store online
tory burch outlet online
louis vuitton outlet stores
lebron shoes
ralph lauren outlet
cheap ray ban sunglasses
longchamp handbags
ray ban sunglasses outlet
louis vuitton handbags
prada outlet online
coach outlet online
michael kors outlet online
swarovski jewellery
coach handbags outlet
oakley sunglasses sale
nike air max 90
mbt shoes outlet
cheap oakley sunglasses
gucci outlet online
nhl jerseys wholesale
air max 90
polo outlet
coach outlet store online
rolex uk
cheap oakley sunglasses
coach factory outlet
cleveland cavaliers jerseys
beats by dre
ecco outlet
nike store uk
coach outlet clearance
louis vuitton uk
nike outlet store online
christian louboutin shoes
coach outlet online
michael kors uk
oakley sunglasses wholesale
polo ralph lauren outlet
beats by dre
coach outlet
cheap ray bans
polo outlet online
michael kors outlet
adidas nmd
ralph lauren uk
ray ban sunglasses uk
cheap ray ban sunglasses
coach outlet
polo ralph lauren
nike roshe run
swarovski crystal
cheap ray ban sunglasses
louis vuitton
michael kors uk
coach outlet clearance
swarovski crystal
christian louboutin shoes
polo ralph lauren
gucci borse
nba jerseys wholesale
beats headphones
ray ban sunglasses uk
birkenstock shoes
gucci bags
coach outlet clearance
chanyuan
 
Posts: 603
Joined: Tue May 09, 2017 9:06 am

Next

Return to EZ GUI General

Who is online

Users browsing this forum: No registered users and 4 guests

cron