xref: /haiku/src/kits/storage/disk_device/DiskDeviceJob.cpp (revision 76e9533e9e9945f62053bf7c737df2f3e1735bbd)
1 /*
2  * Copyright 2007, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include "DiskDeviceJob.h"
7 
8 #include "PartitionReference.h"
9 
10 
11 // constructor
12 DiskDeviceJob::DiskDeviceJob(PartitionReference* partition,
13 		PartitionReference* child)
14 	: fPartition(partition),
15 	  fChild(child)
16 {
17 	if (fPartition)
18 		fPartition->AcquireReference();
19 
20 	if (fChild)
21 		fChild->AcquireReference();
22 }
23 
24 
25 // destructor
26 DiskDeviceJob::~DiskDeviceJob()
27 {
28 	if (fPartition)
29 		fPartition->ReleaseReference();
30 
31 	if (fChild)
32 		fChild->ReleaseReference();
33 }
34