mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 392493 - "Add forget() method to nsCOMPtr and nsRefPtr". r=dbaron.
This commit is contained in:
parent
66461b8ebc
commit
ad07b81a06
@ -404,6 +404,15 @@ int main()
|
||||
printf("Should destroy 3 |TestObject|s:\n");
|
||||
}
|
||||
|
||||
{
|
||||
printf("Should create one |TestRefObject|:\n");
|
||||
nsRefPtr<TestRefObject> pobj( new TestRefObject() );
|
||||
printf("Should do nothing:\n");
|
||||
nsRefPtr<TestRefObject> pobj2( pobj.forget() );
|
||||
printf("Should destroy one |TestRefObject|:\n");
|
||||
}
|
||||
|
||||
|
||||
printf("\nTesting construction.\n");
|
||||
|
||||
{
|
||||
|
@ -626,6 +626,15 @@ main()
|
||||
printf("### End Test 23\n");
|
||||
|
||||
|
||||
{
|
||||
printf("\n### setup for Test 24\n");
|
||||
nsCOMPtr<IFoo> fooP( do_QueryInterface(new IFoo) );
|
||||
|
||||
printf("### Test 24: does |forget| avoid an AddRef/Release when assigning to another nsCOMPtr?\n");
|
||||
nsCOMPtr<IFoo> fooP2( fooP.forget() );
|
||||
}
|
||||
printf("### End Test 24\n");
|
||||
|
||||
{
|
||||
nsCOMPtr<IFoo> fooP;
|
||||
|
||||
@ -643,7 +652,7 @@ main()
|
||||
}
|
||||
|
||||
|
||||
printf("\n### Test 24: will a static |nsCOMPtr| |Release| before program termination?\n");
|
||||
printf("\n### Test 25: will a static |nsCOMPtr| |Release| before program termination?\n");
|
||||
gFoop = do_QueryInterface(new IFoo);
|
||||
|
||||
printf("<<main()\n");
|
||||
|
Loading…
Reference in New Issue
Block a user